Program Listing for File keyframe-writer.h

Return to documentation for file (include\metadata\keyframe-writer.h)

/******************************************************************************
© Intel Corporation.

This software and the related documents are Intel copyrighted materials,
and your use of them is governed by the express license under which they
were provided to you ("License"). Unless the License provides otherwise,
you may not use, modify, copy, publish, distribute, disclose or transmit
this software or the related documents without Intel's prior written
permission.


 This software and the related documents are provided as is, with no express
or implied warranties, other than those that are expressly stated in the
License.

******************************************************************************/

#pragma once

#include "serialization/common.h"
#include "keyframe-header.h"

#include <cstdint>

namespace gpa {

struct DataChangeDesc;

namespace serialization {
class RandomAccessSerializer;

namespace metadata {

class KeyframeWriter
{
public:
    KeyframeWriter(RandomAccessSerializer* serializer);
    ~KeyframeWriter();

    // TODO: this is intentionally copied from DataManager; until this declaration
    //       is moved to a common location, make sure that this type stays in sync
    //       with the declaration in DataManager
    typedef uint64_t ObjectRef;

    void WriteApiCall(serialization::APICallLocation const* description);
    void WriteResourceUpdate(uint64_t threadId, uint64_t offset, uint64_t timestamp = (uint64_t)-1);
    void WriteThreadRestartOffset(uint64_t threadId, uint64_t offset);
    void WriteSubcaptureData();
    void Commit(int64_t frameNumber = -1);
    void UpdateKeyframeFlags(uint32_t flags);
    void UpdateTimestamp(uint64_t timestamp);

private:
    KeyframeHeader* ObtainHeaderPointer();

    RandomAccessSerializer* mSerializer;
    uint64_t mHeaderOffset;
};

}  // namespace metadata
}  // namespace serialization
}  // namespace gpa