node_management.h
Go to the documentation of this file.
00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 #ifndef __OPC_UA_BINARY_NODEMANAGEMENT_H_
00012 #define __OPC_UA_BINARY_NODEMANAGEMENT_H_
00013 
00014 #include <opc/ua/protocol/attribute_ids.h>
00015 #include <opc/ua/protocol/data_value.h>
00016 #include <opc/ua/protocol/types.h>
00017 #include <opc/ua/protocol/variant.h>
00018 #include <opc/ua/protocol/strings.h>
00019 #include <opc/ua/protocol/variable_access_level.h>
00020 #include <map>
00021 #include <bitset>
00022 
00023 namespace OpcUa
00024 {
00025 
00026   //
00027   // AddNode Message definition
00028   //
00029   
00030   enum SpecifiedAttributesEncoding : uint32_t
00031   {
00032     AccessLevel = 0,
00033     ArrayDimensions = 1,
00034     ContainsNoLoops = 3,
00035     DataType = 4,
00036     Description = 5,
00037     DisplayName = 6,
00038     EventNotifier = 7,
00039     Executable = 8,
00040     Historizing = 9,
00041     InverseName = 10,
00042     IsAbstract = 11,
00043     MinimumSamplingInterval = 12,
00044     Symmetric = 15,
00045     UserAccessLevel = 16,
00046     UserExecutable = 17,
00047     UserWriteMask = 18,
00048     ValueRank = 19,
00049     WriteMask = 20,
00050     Value = 21,
00051   };
00052 
00053   struct EventNotifier
00054   {
00055     static const uint8_t SubscribeToEvents = 1 << 0;
00056     static const uint8_t Reserved = 1 << 1;
00057     static const uint8_t HistoryRead = 1 << 2;
00058     static const uint8_t HistoryWrite = 1 << 3;
00059     //all other bytes are reserved
00060   };
00061 
00062   typedef std::bitset<sizeof(uint32_t)> IntBits;
00063 
00064   struct ObjectAttributes
00065   {
00066     uint32_t SpecifiedAttributes;
00067     LocalizedText DisplayName;
00068     LocalizedText Description;
00069     uint8_t EventNotifier = 0;
00070     uint32_t WriteMask = 0;
00071     uint32_t UserWriteMask = 0;
00072   };
00073 
00074   struct VariableAttributes
00075   {
00076     uint32_t SpecifiedAttributes;
00077     LocalizedText DisplayName;
00078     LocalizedText Description;
00079     Variant Value;
00080     NodeId Type;
00081     int32_t Rank = 0;
00082     std::vector<uint32_t> Dimensions;
00083     VariableAccessLevel AccessLevel = VariableAccessLevel::CurrentRead;
00084     VariableAccessLevel UserAccessLevel = VariableAccessLevel::CurrentRead;
00085     Duration MinimumSamplingInterval = 0;
00086     bool Historizing = false;
00087     uint32_t WriteMask = 0;
00088     uint32_t UserWriteMask = 0;
00089   };
00090 
00091   struct MethodAttributes
00092   {
00093     uint32_t SpecifiedAttributes;
00094     LocalizedText DisplayName;
00095     LocalizedText Description;
00096     bool Executable = false;
00097     bool UserExecutable = false;
00098     uint32_t WriteMask = 0;
00099     uint32_t UserWriteMask = 0;
00100   };
00101 
00102   struct ObjectTypeAttributes
00103   {
00104     uint32_t SpecifiedAttributes;
00105     LocalizedText DisplayName;
00106     LocalizedText Description;
00107     bool IsAbstract = false;
00108     uint32_t WriteMask = 0;
00109     uint32_t UserWriteMask = 0;
00110   };
00111 
00112   struct VariableTypeAttributes
00113   {
00114     uint32_t SpecifiedAttributes;
00115     LocalizedText DisplayName;
00116     LocalizedText Description;
00117     Variant Value;
00118     NodeId Type;
00119     int32_t Rank = 0;
00120     std::vector<uint32_t> Dimensions;
00121     bool IsAbstract = false;
00122     uint32_t WriteMask = 0;
00123     uint32_t UserWriteMask = 0;
00124   };
00125 
00126   struct ReferenceTypeAttributes
00127   {
00128     uint32_t SpecifiedAttributes;
00129     LocalizedText DisplayName;
00130     LocalizedText Description;
00131     bool IsAbstract = false;
00132     bool Symmetric = false;
00133     LocalizedText InverseName;
00134     uint32_t WriteMask = 0;
00135     uint32_t UserWriteMask = 0;
00136   };
00137 
00138   struct DataTypeAttributes
00139   {
00140     uint32_t SpecifiedAttributes;
00141     LocalizedText DisplayName;
00142     LocalizedText Description;
00143     bool IsAbstract = false;
00144     uint32_t WriteMask = 0;
00145     uint32_t UserWriteMask = 0;
00146   };
00147 
00148   struct ViewAttributes
00149   {
00150     uint32_t SpecifiedAttributes;
00151     LocalizedText DisplayName;
00152     LocalizedText Description;
00153     bool ContainsNoLoops = true;
00154     uint32_t WriteMask = 0;
00155     uint32_t UserWriteMask = 0;
00156   };
00157 
00158   struct NodeAttributes
00159   {
00160     ExtensionObjectHeader Header;
00161     uint32_t SpecifiedAttributes;
00162     std::map<AttributeId, Variant> Attributes;
00163 
00164     NodeAttributes(){}
00165     NodeAttributes(const ObjectAttributes&);
00166     NodeAttributes(const VariableAttributes&);
00167     NodeAttributes(const MethodAttributes&);
00168     NodeAttributes(const ObjectTypeAttributes&);
00169     NodeAttributes(const VariableTypeAttributes&);
00170     NodeAttributes(const ReferenceTypeAttributes&);
00171     NodeAttributes(const DataTypeAttributes&);
00172     NodeAttributes(const ViewAttributes&);
00173   };
00174 
00175   // TODO Rename to NodeParameters
00176   struct AddNodesItem
00177   {
00178     NodeId ParentNodeId;
00179     NodeId ReferenceTypeId;
00180     NodeId RequestedNewNodeId;
00181     QualifiedName BrowseName;
00182     NodeClass Class;
00183     NodeAttributes Attributes;
00184     NodeId TypeDefinition;
00185   };
00186 
00187 
00188   struct AddNodesParameters
00189   {
00190     std::vector<AddNodesItem> NodesToAdd;
00191   };
00192 
00193   struct AddNodesRequest
00194   {
00195     NodeId TypeId;
00196     RequestHeader Header;
00197     AddNodesParameters Parameters;
00198     AddNodesRequest();
00199   };
00200 
00201   struct AddNodesResult
00202   {
00203     StatusCode Status;
00204     NodeId AddedNodeId;
00205   };
00206   
00207   struct AddNodesResponse
00208   {
00209     NodeId TypeId;
00210     ResponseHeader Header;
00211     std::vector<AddNodesResult> results;
00212     DiagnosticInfoList Diagnostics;
00213     AddNodesResponse();
00214   };
00215 
00216 
00217   //
00218   // AddReference
00219   //
00220 
00221   struct AddReferencesItem
00222   {
00223     NodeId SourceNodeId;
00224     NodeId ReferenceTypeId;
00225     bool IsForward;
00226     std::string TargetServerUri;
00227     NodeId TargetNodeId;
00228     NodeClass TargetNodeClass;
00229   };
00230 
00231   struct AddReferencesParameters
00232   {
00233     std::vector<AddReferencesItem> ReferencesToAdd;
00234   };
00235 
00236   struct AddReferencesRequest
00237   {
00238     NodeId TypeId;
00239     RequestHeader Header;
00240     AddReferencesParameters Parameters;
00241 
00242     AddReferencesRequest();
00243   };
00244 
00245   struct AddReferencesResponse
00246   {
00247     NodeId TypeId;
00248     ResponseHeader Header;
00249     std::vector<StatusCode> Results;
00250     DiagnosticInfoList Diagnostics;
00251 
00252     AddReferencesResponse();
00253   };
00254 
00255   //FIXME: move somewhere else!!
00256   const char* GetObjectIdName(const NodeId& id) ;
00257 
00258 
00259 }
00260 
00261 #endif 


ros_opcua_impl_freeopcua
Author(s): Denis Štogl
autogenerated on Sat Jun 8 2019 18:24:56