8 #include "Arp/System/Rsc/Services/IRscSerializable.hpp" 9 #include "Arp/System/Rsc/Services/RscReader.hpp" 10 #include "Arp/System/Rsc/Services/RscString.hxx" 11 #include "Arp/System/Rsc/Services/RscWriter.hpp" 12 namespace Arp {
namespace Plc {
namespace Commons {
namespace Meta
47 static TypeIdentifier Create(
const String& commonTypeName,
const char* libraryNamespace,
void* typeTag =
nullptr);
56 bool IsEmpty(
void)
const;
59 const String& GetName(
void)
const;
63 const String& GetNamespace(
void)
const;
67 String GetFullName(
void)
const;
71 const byte* GetTypeTag(
void)
const;
75 const byte* GetChangeCounterpartTypeTag(
void)
const;
79 size_t GetHashValue(
void)
const;
83 size_t GetCacheSize()
const;
89 String ToString(
void)
const;
93 void SwapDomain(
void);
100 void Serialize(
RscWriter& writer)
const override;
101 void Deserialize(
RscReader& reader)
override;
102 static size_t GetFieldCount(
void);
105 void SetChangeCounterpartTypeTag(
const byte* value);
110 const byte* typeTag =
nullptr;
111 const byte* changeCounterpartTypeTag =
nullptr;
114 static const char namespaceSeparator =
'/';
121 , namespace_(namespace_)
122 , typeTag(reinterpret_cast<const
byte*>(typeTag))
128 return this->name.IsEmpty() && this->namespace_.IsEmpty();
137 return this->namespace_;
141 return this->namespace_ + namespaceSeparator + this->name;
145 return this->typeTag;
150 return this->changeCounterpartTypeTag;
157 std::hash<String> gethash;
158 return gethash(this->namespace_) ^ gethash(this->name);
163 std::swap(this->typeTag, this->changeCounterpartTypeTag);
166 inline size_t TypeIdentifier::GetFieldCount()
171 inline void TypeIdentifier::SetChangeCounterpartTypeTag(
const byte* value)
173 this->changeCounterpartTypeTag = value;
178 size_t cacheSize = 0;
179 cacheSize += this->name.Capacity();
180 cacheSize += this->namespace_.Capacity();
181 cacheSize +=
sizeof(this->typeTag);
182 cacheSize +=
sizeof(this->changeCounterpartTypeTag);
183 cacheSize +=
sizeof(this->namespaceSeparator);
195 return this->name == rhs.name && this->namespace_ == rhs.namespace_;
201 return (this->namespace_ == rhs.namespace_) ? (this->name < rhs.name) : (this->namespace_ < rhs.namespace_);
219 struct hash<
Arp::Plc::Commons::Meta::TypeIdentifier>
226 typedef size_t result_type;
229 result_type operator()(
const argument_type& key)
const Reads data from Rsc
Definition: RscReader.hpp:23
Writes data to Rsc.
Definition: RscWriter.hpp:32
Namespace for classes and interfaces for the Remote Service Call implementation
Namespace of the C++ standard library
bool operator<(Enum< T > lhs, Enum< T > rhs)
Less operator for class Enum.
Definition: Enum.hxx:228
Marshalls structure or class data types. Serialize and Deserialize have to marshal fields in the same...
Definition: IRscSerializable.hpp:18
Root namespace for the PLCnext API
std::ostream & operator<<(std::ostream &os, Enum< T > value)
Makes the Enum class loggable and streamable.
Definition: Enum.hxx:208
bool operator==(Enum< T > lhs, Enum< T > rhs)
Equality operator for class Enum.
Definition: Enum.hxx:218
unsigned char byte
The Arp character type.
Definition: PrimitiveTypes.hpp:23