SESerializeState.h
1/* Distributed under the Apache License, Version 2.0.
2 See accompanying NOTICE file for details.*/
3
4#pragma once
5#include "cdm/engine/SEAction.h"
6
7// Keep enums in sync with appropriate schema/cdm/ActionEnums.proto file !!
8enum class eSerialization_Mode { Save = 0, Load };
9extern CDM_DECL const std::string& eSerialization_Mode_Name(eSerialization_Mode m);
10
11class CDM_DECL SESerializeState : public SEAction
12{
13 friend class PBAction;//friend the serialization class
14public:
15
16 SESerializeState(Logger* logger=nullptr);
17 virtual ~SESerializeState();
18
19 static constexpr char const* Name = "Serialize State";
20 std::string GetName() const override { return Name; }
21
22 void Clear() override; //clear memory
23
24 bool IsValid() const override;
25
26 virtual eSerialization_Mode GetMode() const;
27 virtual void SetMode(eSerialization_Mode m);
28
29 virtual bool HasFilename() const;
30 virtual std::string GetFilename() const;
31 virtual void SetFilename(const std::string& filename);
32 virtual void InvalidateFilename();
33
34 const SEScalar* GetScalar(const std::string& name) override;
35
36protected:
37
38 std::string m_Filename;
39 eSerialization_Mode m_Mode;
40};
Definition: Logger.h:71
Definition: PBActions.h:15
Definition: SEAction.h:14
virtual const SEScalar * GetScalar(const std::string &name)=0
virtual bool IsValid() const
Definition: SEAction.h:35
virtual void Clear()
Definition: SEAction.cpp:21
Definition: SEScalar.h:19
Definition: SESerializeState.h:12
std::string m_Filename
Definition: SESerializeState.h:38
std::string GetName() const override
Definition: SESerializeState.h:20
eSerialization_Mode m_Mode
Definition: SESerializeState.h:39

Distributed under the Apache License, Version 2.0.

See accompanying NOTICE file for details.