Safir SDK Core
Loading...
Searching...
No Matches
Command.h
Go to the documentation of this file.
1#pragma once
2
9
11#include <Safir/Dob/Service.h>
13
14#include <Safir/Utilities/Internal/VisibilityHelpers.h>
15
16#ifdef safir_generated_Core_cpp_EXPORTS
17# define SAFIR_GENERATED_Core_API SAFIR_HELPER_DLL_EXPORT
18#else
19# define SAFIR_GENERATED_Core_API SAFIR_HELPER_DLL_IMPORT
20# define SAFIR_LIBRARY_NAME "safir_generated-Core-cpp"
21# include <Safir/Utilities/Internal/AutoLink.h>
22#endif
23#define SAFIR_GENERATED_Core_API_LOCAL SAFIR_HELPER_DLL_LOCAL
24
28namespace Safir
29{
33namespace Control
34{
35
36 class Command; //forward declaration
37 typedef std::shared_ptr<Command> CommandPtr;
38 typedef std::shared_ptr<const Command> CommandConstPtr;
39
43
49 {
50 public:
51 //Constructors and Create routines
55
56 //Operation
63
64
65 //NodeId
72
73
75 static const Safir::Dob::Typesystem::TypeId ClassTypeId = -4863719572745053473LL;
76
77 //Type id for Command
78 Safir::Dob::Typesystem::TypeId GetTypeId() const override {return ClassTypeId;}
79
80 //Check if anything in the object has change flags set
81 bool IsChanged() override;
82
83 //Recursively set all change flags in the object
84 void SetChanged(const bool changed) override;
85
86
87 //Reflection part (Don't use unless you really know what you're doing!!)
89 const Safir::Dob::Typesystem::ArrayIndex index) override;
91 const Safir::Dob::Typesystem::ArrayIndex index) const override;
92
93 void WriteToBlob(Safir::Dob::Typesystem::Int64 handle) const override;
95
96 private:
97
98#ifdef _MSC_VER
99#pragma warning (push)
100#pragma warning (disable : 4251)
101#endif
102
105
106#ifdef _MSC_VER
107#pragma warning (pop)
108#endif
109 };
110
111} // Control
112} // Safir
113
114
#define SAFIR_GENERATED_Core_API
Definition BackdoorCommand.h:18
This namespace contains all the functionality and definitions of the SAFIR SDK.
Definition Backdoor.h:31
DotsC_Int64 Int64
64 bit integer type.
Definition Defs.h:69
std::shared_ptr< Object > ObjectPtr
A smart pointer to an Object.
Definition Object.h:44
DotsC_ArrayIndex ArrayIndex
Index into an array.
Definition Defs.h:246
DotsC_TypeId TypeId
A unique type identifier.
Definition Defs.h:218
DotsC_MemberIndex MemberIndex
The index of a member in an object.
Definition Defs.h:237
Safir::Dob::Typesystem::ArrayContainer< CommandContainer > CommandContainerArray
Definition Command.h:41
std::shared_ptr< Command > CommandPtr
Definition Command.h:37
std::shared_ptr< const Command > CommandConstPtr
Definition Command.h:38
Safir::Dob::Typesystem::ObjectContainerImpl< Command > CommandContainer
Definition Command.h:40
Safir::Dob::Typesystem::GenericObjectSequenceContainer< Command > CommandSequenceContainer
Definition Command.h:42
STL container for arrays of DOB-containers.
Definition ArrayContainer.h:59
Base class for all Containers.
Definition ContainerBase.h:44
Definition ContainerProxies.h:39
Template class for all containers of automatically generated DOB objects.
Definition ObjectContainer.h:190
Container for base types.
Definition ValueContainers.h:61
Command to stop, shutdown or reboot a specific node or a whole safir system.
Definition Command.h:49
Safir::Dob::Typesystem::TypeId GetTypeId() const override
Get the type id of this object.
Definition Command.h:78
void SetChanged(const bool changed) override
Recursively set change flags in all members of this object.
void WriteToBlob(Safir::Dob::Typesystem::Int64 handle) const override
Write the object to a blob.
Command(Safir::Dob::Typesystem::Int64 handle)
bool IsChanged() override
Check if any member of this object is changed.
Safir::Dob::Typesystem::ContainerBase & GetMember(const Safir::Dob::Typesystem::MemberIndex member, const Safir::Dob::Typesystem::ArrayIndex index) override
Get a reference to a member container from an object.
Safir::Dob::Typesystem::ObjectPtr Clone() const override
Create a copy of the object.
static CommandPtr Create()
Safir::Dob::Typesystem::ContainerProxy< Safir::Dob::Typesystem::Int64Container > NodeId()
const Safir::Dob::Typesystem::ContainerProxy< Safir::Dob::Typesystem::Int64Container > NodeId() const
The node to apply the operation to.
static Safir::Dob::Typesystem::MemberIndex OperationMemberIndex()
const Safir::Dob::Typesystem::ContainerBase & GetMember(const Safir::Dob::Typesystem::MemberIndex member, const Safir::Dob::Typesystem::ArrayIndex index) const override
Get a const reference to a member container from an object.
static Safir::Dob::Typesystem::MemberIndex NodeIdMemberIndex()
const Safir::Dob::Typesystem::ContainerProxy< Safir::Control::Operation::EnumerationContainer > Operation() const
Operation to be performed on a whole safir system or a specific node.
Safir::Dob::Typesystem::ContainerProxy< Safir::Control::Operation::EnumerationContainer > Operation()
The baseclass for all services.
Definition Service.h:46