8#include "Arp/Plc/Commons/DataType.hpp"
9#include "Arp/System/Rsc/Services/RscType.hpp"
11namespace Arp {
namespace Plc {
namespace Commons
36 void ResetIndirection();
50 bool IsComplex(
bool useBaseType =
true)
const;
96inline DataTypeEnum::operator
DataType()
const
101inline bool DataTypeEnum::operator==(
DataType rhs)
const
103 return this->value == rhs;
113 return (this->value & flag) == flag;
124 if ((baseDataType !=
DataType::None) && (baseDataType <= DataType::Primitive))
142 return (baseType > DataType::Primitive) && (baseType <= DataType::Elementary);
155 return (baseType > DataType::Elementary) && (baseType <= DataType::Complex);
165 return this->
IsSet(DataType::Reference);
206 const bool isIecObjectType =
211 return this->
IsArray() || isIecObjectType;
222 return (baseType > DataType::Elementary) && (baseType <= DataType::Complex);
235inline void DataTypeEnum::SetFlags(
DataType flags)
237 this->value = (this->value | flags);
240inline void DataTypeEnum::ResetFlags(
DataType flags)
242 this->value = (this->value & ~flags);
Definition: DataTypeEnum.hpp:16
bool IsReference(void) const
Checks if this data type is a reference type.
Definition: DataTypeEnum.hpp:163
bool IsIndirect(void) const
Checks if this data type is an indirect data type, that is a pointer or reference type.
Definition: DataTypeEnum.hpp:168
bool IsString(void) const
Checks if this data type is a string type.
Definition: DataTypeEnum.hpp:183
size_t GetBaseSize(void) const
Returns the size of the base data type if it could be deduced, otherwise 0
DataTypeEnum(const DataTypeEnum &arg)=default
Copy constructor.
bool IsArray(void) const
Checks if this data type is an array.
Definition: DataTypeEnum.hpp:173
bool IsAnySet(DataType flags) const
Checks if any of the given flags is set.
Definition: DataTypeEnum.hpp:116
bool IsIecObject(void) const
Checks if this data type is a managed object inside the IEC context.
Definition: DataTypeEnum.hpp:203
DataTypeEnum(DataType dataType)
Constructs an DataTypeEnum instance.
Definition: DataTypeEnum.hpp:91
bool IsEnum(void) const
Checks if this data type is an enum.
Definition: DataTypeEnum.hpp:178
bool IsEmpty(void) const
True if not set
Definition: DataTypeEnum.hpp:230
DataTypeEnum GetBaseDataType(void) const
Returns the element type for an array, the underlying type for an enum, and the referenced type for a...
Definition: DataTypeEnum.hpp:225
DataTypeEnum & operator=(const DataTypeEnum &arg)=default
Assignment operator.
bool IsComplex(bool useBaseType=true) const
Checks if this data type is complex.
Definition: DataTypeEnum.hpp:145
bool IsSet(DataType flag) const
Checks if the given flag is set.
Definition: DataTypeEnum.hpp:111
bool HasChilds(void) const
Checks if this data type might have any childs. Pointer of structs are treated as structs,...
Definition: DataTypeEnum.hpp:214
size_t GetSize(void) const
Returns the size of the this data type if it could be deduced, otherwise 0
RscType GetRscType() const
Returns the associated rsc type.
DataType GetValue(void) const
Returns the unwraped original enum value of type DataType.
Definition: DataTypeEnum.hpp:106
~DataTypeEnum(void)=default
Destructs this instance and frees all resources.
bool Is8BitString() const
Checks if this data type is a 8 byte string type.
Definition: DataTypeEnum.hpp:188
bool IsPointer(void) const
Checks if this data type is a pointer type.
Definition: DataTypeEnum.hpp:158
bool IsElementary(bool useBaseType=true) const
Checks if this data type is elementary (but not primitive).
Definition: DataTypeEnum.hpp:132
size_t GetDataAlignment(void) const
Returns the alignment of this data type if it could be deduced, otherwise 0
DataTypeEnum(DataTypeEnum &&arg)=default
Move constructor.
bool IsPrimitive(void) const
Checks if this data type is primitive.
Definition: DataTypeEnum.hpp:121
bool IsWideString() const
Checks if this data type is a wide string type.
Definition: DataTypeEnum.hpp:196
DataType
Definition: DataType.hpp:15
@ BaseTypeMask
summary>For removing all flags
@ String
summary>Static Wide String type (UTF-16)
@ Component
summary>Library
@ IecString
summary>.NET/C# String type, only for internal use (not supported yet)
@ StaticWString
summary>Iec Wide String type (UTF-16), only for internal use
@ IecWString
summary>Limit of elementary types.
@ StaticString
summary>Iec String type, only for internal use
@ None
summary>Unspecified.
@ FunctionBlock
summary>Subsystem
@ Program
summary>Component
@ Class
summary>Function Block
RscType
Data types supported by RSC.
Definition: RscType.hpp:36
Root namespace for the PLCnext API