Program Listing for File restore-point-operation.h

Return to documentation for file (include\serialization\restore-point-operation.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 "operations/operation.h"

#include <string>
#include <vector>

namespace gpa {
namespace serialization {

class RestorePointOperation : public Operation
{
public:
    enum class Type {
        kStream,       // Indicates that this RestorePointOperation will restore the entire state of the stream
        kStreamBegin,  // Indicates that this RestorePointOperation marks the beginning of stream state restoration
        kStreamEnd,    // Indicates that this RestorePointOperation marks the end of stream state restoration
        kResource,     // Indicates that this RestorePointOperation will restore the state of a single resource
    };

    RestorePointOperation();
    ~RestorePointOperation();

    char const* GetName() const override;

    size_t Serialize(MemoryBackedSerializer* serializer) const override;
    size_t Deserialize(MemoryBackedSerializer* serializer) override;

    bool IsSuccessful() override;
    Type GetType() const;
    void SetType(Type type);
    uint64_t GetResourceTypeId() const;
    void SetResourceTypeId(uint64_t resourceTypeId);
    uint64_t GetResourceId() const;
    void SetResourceId(uint64_t resourceId);
    uint64_t GetSerializedDataOffset() const;
    void SetSerializedDataOffset(uint64_t serializedDataOffset);
    uint64_t GetSerializedDataSize() const;
    void SetSerializedDataSize(uint64_t serializedDataSize);
    uint64_t GetTimestemp() const;
    void SetTimestamp(uint64_t timestamp);

private:
    Type mType{Type::kStream};
    uint64_t mResourceTypeId{0};
    uint64_t mResourceId{0};
    uint64_t mSerializedDataOffset{0};
    uint64_t mSerializedDataSize{0};
    uint64_t mTimestamp{0};
};

}  // namespace serialization
}  // namespace gpa