Class CEntity#
Defined in File entity_base.h
Nested Relationships#
Nested Types#
Inheritance Relationships#
Base Types#
public sdv::idl::IEntityInfo
(Struct IEntityInfo)public sdv::idl::IEntityComments
(Struct IEntityComments)public sdv::idl::IEntityContext
(Struct IEntityContext)public sdv::idl::IForwardDeclarationEntity
(Struct IForwardDeclarationEntity)public sdv::IInterfaceAccess
(Struct IInterfaceAccess)public std::enable_shared_from_this< CEntity >
Derived Types#
public CDeclarationEntity
(Class CDeclarationEntity)public CDefinitionEntity
(Class CDefinitionEntity)public CMetaEntity
(Class CMetaEntity)
Class Documentation#
-
class CEntity : public sdv::idl::IEntityInfo, public sdv::idl::IEntityComments, public sdv::idl::IEntityContext, public sdv::idl::IForwardDeclarationEntity, public sdv::IInterfaceAccess, public std::enable_shared_from_this<CEntity>#
Base of the entities allowing generic access to the entity.
Remark
Normally a declaration entity cannot have child entities. It would make sense to manage child entities only by the definition entity. OMG IDL imposes naming restrictions for all the entities. And forward declarations are allowed. This requires that child management is implemented on a base level, even though declarations will not have any children.
Subclassed by CDeclarationEntity, CDefinitionEntity, CMetaEntity
Unnamed Group
Unnamed Group
-
CContextPtr GetContext() const#
Get the parse context.
- Returns:
Returns the parse context.
-
CContextPtr GetContext()#
Get the parse context.
- Returns:
Returns the parse context.
Unnamed Group
-
CEntityPtr GetParentEntity() const#
Get the parent entity of this entity.
- Returns:
Returns the smart pointer to the parent entity or NULL when this is the root entity.
-
CEntityPtr GetParentEntity()#
Get the parent entity of this entity.
- Returns:
Returns the smart pointer to the parent entity or NULL when this is the root entity.
Unnamed Group
-
CEntityPtr GetRootEntity() const#
Get the root entity.
- Returns:
Returns the root entity.
-
CEntityPtr GetRootEntity()#
Get the root entity.
- Returns:
Returns the root entity.
Unnamed Group
-
CEntityPtr GetResolvedEntity() const#
Get resolved entity if the entity is a typedef (or multiple typedefs).
- Returns:
Returns resolved entity.
-
CEntityPtr GetResolvedEntity()#
Get resolved entity if the entity is a typedef (or multiple typedefs).
- Returns:
Returns resolved entity.
Unnamed Group
-
inline void SetBeginPosition(uint32_t uiLine, uint32_t uiCol)#
Set the position during parsing.
- Parameters:
uiLine – [in] The line number.
uiCol – [in] The column number.
-
inline void SetEndPosition(uint32_t uiLine, uint32_t uiCol)#
Set the position during parsing.
- Parameters:
uiLine – [in] The line number.
uiCol – [in] The column number.
Unnamed Group
Unnamed Group
-
inline const CValueNodePtr &ValueRef() const#
Get a reference to the calculated value. Consider.
- Throws:
Throws – an exception when the index doesn’t correspond to the size of the array.
- Returns:
The value struct smart pointer of the specified type.
-
inline CValueNodePtr &ValueRef()#
Get a reference to the calculated value. Consider.
- Throws:
Throws – an exception when the index doesn’t correspond to the size of the array.
- Returns:
The value struct smart pointer of the specified type.
Public Functions
-
CEntity(const CContextPtr &rptrContext, CEntityPtr ptrParent)#
Constructor using the parser to process the code.
- Parameters:
rptrContext – [in] Reference to the smart pointer holding the parse context. Must not be NULL.
ptrParent – [in] Pointer to the parent class holding this entity. This must not be NULL.
-
CEntity(const CContextPtr &rptrContext, CEntityPtr ptrParent, const CTokenList &rlstTokenList)#
Constructor using the provided token-list to process the code.
- Parameters:
rptrContext – [in] Reference to the smart pointer holding the parse context. Must not be NULL.
ptrParent – [in] Pointer to the parent class holding this entity. This must not be NULL.
rlstTokenList – [in] Reference to the token list holding the tokens to process.
-
virtual ~CEntity() = default#
Destructor.
-
virtual sdv::interface_t GetInterface(sdv::interface_id idInterface) override#
Get access to another interface. Overload of sdv::IInterfaceAccess::GetInterface.
- Parameters:
idInterface – [in] The interface id to get access to.
- Returns:
Returns a pointer to the interface or NULL when the interface is not supported.
-
virtual sdv::idl::EEntityType GetType() const override#
Get the type of the entity. Default type is sdv::idl::EEntityType::type_unknown. Overload of sdv::idl::IEntityInfo::GetType.
- Returns:
Returns the entity type.
-
virtual sdv::IInterfaceAccess *GetEntity() override#
Get the entity if this is a forward declared entity. Overload of sdv::idl::IForwardDeclarationEntity.
- Returns:
Pointer to the entity this forward declaration is referring to. Or NULL when no entity was defined.
-
virtual std::string GetDeclTypeStr(bool bResolveTypedef) const#
Get the declaration type of the entity as string.
For declaration entities, the type returned includes the declaration type. For definition entities, the type returned have the for of “<base type> <type identifier>”.
- Attention
To get the qualified type including array sizes, use the GetDeclTypeStr of the CEntityValueNode class.
- Parameters:
bResolveTypedef – [in] When set, resolve the typedef type into the base type.
- Returns:
Returns the entity declaration type string.
-
virtual void Process() = 0#
Process the code. Entity specific processing function. Must be derived.
The processing of follows the following stages:
Process definition - determine the type blue-print
Process declaration - determine the identifier
Process assignment - build value chains It is not required to process all three steps. A definition can be made without a following declaration. A declaration can be made based on a previous definition. Whether or not a definition is made, is determined from the token sequence (grammar). In principal, if the statements are not specifying a definition, they are specifying a declaration or both (a declaration following the definition). Processing assignments is triggered by the complex processing entities (modules, structs, unions, interfaces, enums). In modules and enums, a declaration statement is processed for assignents directly. In structs and unions, the use of member variables is allowed even if they are defined later and have not been processed yet. Therefore, the declarations of all members in the structs and unions are processed first and the assignments are following after this. Assignments are only possible following a declaration. Therefore, the process assignment function is only implemented in the CDeclarationEntity class implementing typedefs, const declarations and variable declarations. The assignment of values is possible also for enums, structs, unions and interfaces. The overloadable ProcessAsignmentValue function is used for this.
-
virtual sdv::u8string GetName() const override#
Get the name of the entity. Overload of IEntityInfo::GetName.
- Returns:
The name string.
-
virtual sdv::u8string GetScopedName() const override#
Get the scoped name of the entity (including the modules separated by the scope separator). Overload of IEntityInfo::GetScopedName.
- Returns:
The scoped name build from the entities of the parents separated by ‘::’. An empty name means global scope.
-
std::string MakeFullScoped(const std::string &rssExpression) const#
Replace any identifier in the expression with a relative scope to this entity by a full scoped identifier.
Remark
If an entity in the expression cannot be found within the current scope, the entity is not corrected and replaced without change in the retargeted expression.
- Parameters:
rssExpression – [in] Reference to the expression to use for retargeting.
- Returns:
The expression with full scoped identifiers.
-
inline bool IsEqual(CEntityPtr ptrEntity)#
Has equal.
- Parameters:
ptrEntity – [in] Pointer to the entity to use for the comparison.
- Returns:
Returns ‘true’ when the entities have the identical scoped names.
-
virtual sdv::IInterfaceAccess *GetParent() const override#
Get the parent entity of this entity. Overload of IEntityInfo::GetParent.
- Returns:
Returns an interface to the parent entity or NULL when this is the root parent (when there is no parent).
-
void SetCommentTokens(const CTokenList &rlstComments, bool bPreceeding = true)#
Set the comment tokens for this entity.
- Attention
This function doesn’t set any comment if there is already a comment assigned (either through a forward declaration or when a comment is provided beforee and after a declaration). Unless, the new comments have additional information on the comment format (brief, java doc or doxygen) and the initial comments didn’t have this.
- Parameters:
rlstComments – [in] Reference to the comments token list.
bPreceeding – [in] When set, the comments are preceding the next statement; otherwise they are succeeding.
-
CTokenList GetPreCommentTokenList()#
Get the preceding comment token list.
Preceding comments must be located in the same source file as the next token and must be adjacent and end at the latest one line before the next token.
- Returns:
Returns the preceding comment token list.
-
void ProcessPostCommentTokenList(uint32_t uiLine)#
Process the succeeding comment token list and assign to the current entity.
Succeeding comments must be located in the same source file as the entity and must be adjacent and start at the provided line.
- Parameters:
uiLine – [in] The line to start checking for succeeding comments at.
-
virtual sdv::u8string GetComments(uint32_t &ruiFlags) const override#
Get the comment lines for this entity as one string. Overload of IEntityComments::GetComments.
Remark
For c-style multi-line comments, the indentation and additional asterisk character at the beginning of each line is removed.
- Parameters:
ruiFlags – [out] Reference to the variable receiving the comment flags (a bitmask combination of sdv::idl::IEntityComments::ECommentMask).
- Returns:
Returns the comment string. If the comment contains multiple lines, each line is ending with a newline.
-
virtual sdv::idl::IEntityContext::ELocation GetLocation() const override#
Get the location. Overload of sdv::idl::IEntityContext::GetLocation.
- Returns:
Returns the location.
-
virtual sdv::u8string GetSourcePath() const override#
Get the path to the file. Overload of sdv::idl::IEntityContext::GetSourcePath.
- Returns:
Returns the source path string.
-
virtual void GetPosition(uint32_t &ruiLineBegin, uint32_t &ruiColBegin, uint32_t &ruiLineEnd, uint32_t &ruiColEnd) override#
Get the position in the file. Overload of sdv::idl::IEntityContext::GetPosition.
Remark
Not all entities have a position. If no position is available, the position return value has the value 0.
- Parameters:
ruiLineBegin – [out] Reference to the variable receiving the line number of the entity beginning.
ruiColBegin – [out] Reference to the variable receiving the column number of the entity beginning.
ruiLineEnd – [out] Reference to the variable receiving the line number of the entity ending.
ruiColEnd – [out] Reference to the variable receiving the column number of the entity ending.
-
virtual void CalcHash(CHashObject &rHash) const#
Calculate the hash of this entity and all encapsulated entities.
- Parameters:
rHash – [inout] Hash object to be filled with data.
-
CEntityPtr Find(const std::string &rssScopedName, bool bCheckParent = true) const#
Find the entity using a scoped name.
A scoped name defines an entity name with possible entity parent names. Each name is separated by the scope separator ‘::’. For example: “parent_1::parent_1_a::parent_1_a_I::entity”. The first entity that will be searched for is the uppermost parent (here parent_1). The search starts at the current entity. If the search was not successful, the search is done using the parent and if the search also there was not successful, the parent of the parent is searched for, and so on. The search is successful if all the requested parents match and the entity is found. An exception to the rule of the scoped name is, when the name starts with the scope separator indicating that the search is not relative but should start at the root entity. For example: “::parent::entity”.
- Template Parameters:
TEntity – The entity type to return.
- Parameters:
rssScopedName – [in] Reference to a string object containing the relative or absolute scoped entity name consisting of zero or more parents definitions and one entity name all separated with the scope separator ‘::’ followed by declaration members separated by a member separator ‘.’. The name must not be empty.
bCheckParent – [in] When set, check the parent(s) as well if the scoped name fits on one of the children of a parent; otherwise the parent(s) is(are) not taken into account.
- Returns:
The first version returns an entity smart pointer. The second version returns the entity pointer converted to the requested entity type (if the entity is of this type). If the entity doesn’t exists or is of the wrong type a NULL pointer is returned.
-
template<typename TEntity>
TEntity *Find(const std::string &rssScopedName) const# Find the entity using a scoped name.
A scoped name defines an entity name with possible entity parent names. Each name is separated by the scope separator ‘::’. For example: “parent_1::parent_1_a::parent_1_a_I::entity”. The first entity that will be searched for is the uppermost parent (here parent_1). The search starts at the current entity. If the search was not successful, the search is done using the parent and if the search also there was not successful, the parent of the parent is searched for, and so on. The search is successful if all the requested parents match and the entity is found. An exception to the rule of the scoped name is, when the name starts with the scope separator indicating that the search is not relative but should start at the root entity. For example: “::parent::entity”.
- Template Parameters:
TEntity – The entity type to return.
- Parameters:
rssScopedName – [in] Reference to a string object containing the relative or absolute scoped entity name consisting of zero or more parents definitions and one entity name all separated with the scope separator ‘::’ followed by declaration members separated by a member separator ‘.’. The name must not be empty.
- Returns:
The first version returns an entity smart pointer. The second version returns the entity pointer converted to the requested entity type (if the entity is of this type). If the entity doesn’t exists or is of the wrong type a NULL pointer is returned.
-
CValueNodePtr FindValue(const CTokenList &rlstScopedNameInclMembers) const#
Find the value belonging to the scoped name.
A scoped name defines an entity name with possible entity parent names. Each name is separated by the scope separator ‘::’. For example: “parent_1::parent_1_a::parent_1_a_I::entity”. The first entity that will be searched for is the uppormost parent (here parent_1). The search starts at the current entity. If the search was not successful, the search is done using the parent and if the search also there was not successful, the parent of the parent is searched for, and so on. The search is successful if all the requested parents match and the entity is found. An exception to the rule of the scoped name is, when the name starts with the scope separator indicating that the search is not relative but should start at the root entity. For example: “::parent::entity”. Following the scoped name, members and indices can be specified to navigate to the correct value declaration. Members are separated by a dot ‘.’ and indices are specified using square brackets ‘[…]’. For example “::parent::entity.first[1]”.
- Parameters:
rlstScopedNameInclMembers – [in] Token list consisting of tokens representing the scoped name as well as any array and member names.
- Returns:
Returns a value node smart pointer. If the value node doesn’t exists or is of the wrong type a NULL pointer is returned.
-
CValueNodePtr FindValue(const std::string &rssScopedNameInclMembers) const#
Find the value belonging to the scoped name.
A scoped name defines an entity name with possible entity parent names. Each name is separated by the scope separator ‘::’. For example: “parent_1::parent_1_a::parent_1_a_I::entity”. The first entity that will be searched for is the uppormost parent (here parent_1). The search starts at the current entity. If the search was not successful, the search is done using the parent and if the search also there was not successful, the parent of the parent is searched for, and so on. The search is successful if all the requested parents match and the entity is found. An exception to the rule of the scoped name is, when the name starts with the scope separator indicating that the search is not relative but should start at the root entity. For example: “::parent::entity”. Following the scoped name, members and indices can be specified to navigate to the correct value declaration. Members are separated by a dot ‘.’ and indices are specified using square brackets ‘[…]’. For example “::parent::entity.first[1]”.
- Parameters:
rssScopedNameInclMembers – [in] Reference to a string object containing the relative or absolute scoped entity name consisting of zero or more parents and one entity name all separated with the scope separator ‘::’. The name must not be empty.
- Returns:
Returns a value node smart pointer. If the value node doesn’t exists or is of the wrong type a NULL pointer is returned.
-
template<typename TValueNode>
TValueNode *FindValue(const std::string &rssScopedNameInclMembers) const# Find the value belonging to the scoped name.
A scoped name defines an entity name with possible entity parent names. Each name is separated by the scope separator ‘::’. For example: “parent_1::parent_1_a::parent_1_a_I::entity”. The first entity that will be searched for is the uppormost parent (here parent_1). The search starts at the current entity. If the search was not successful, the search is done using the parent and if the search also there was not successful, the parent of the parent is searched for, and so on. The search is successful if all the requested parents match and the entity is found. An exception to the rule of the scoped name is, when the name starts with the scope separator indicating that the search is not relative but should start at the root entity. For example: “::parent::entity”. Following the scoped name, members and indices can be specified to navigate to the correct value declaration. Members are separated by a dot ‘.’ and indices are specified using square brackets ‘[…]’. For example “::parent::entity.first[1]”.
- Template Parameters:
TValueNode – Type of the value node to return.
- Parameters:
rssScopedNameInclMembers – [in] Reference to a string object containing the relative or absolute scoped entity name consisting of zero or more parents and one entity name all separated with the scope separator ‘::’. The name must not be empty.
- Returns:
Returns the value node pointer converted to the requested value node type (if the value node is of this type). If the value node doesn’t exists or is of the wrong type a NULL pointer is returned.
-
CConstVariant FindValueVariant(const std::string &rssScopedNameInclMembers) const#
Find the value variant belonging to the scoped name.
A scoped name defines an entity name with possible entity parent names. Each name is separated by the scope separator ‘::’. For example: “parent_1::parent_1_a::parent_1_a_I::entity”. The first entity that will be searched for is the uppormost parent (here parent_1). The search starts at the current entity. If the search was not successful, the search is done using the parent and if the search also there was not successful, the parent of the parent is searched for, and so on. The search is successful if all the requested parents match and the entity is found. An exception to the rule of the scoped name is, when the name starts with the scope separator indicating that the search is not relative but should start at the root entity. For example: “::parent::entity”. Following the scoped name, members and indices can be specified to navigate to the correct value declaration. Members are separated by a dot ‘.’ and indices are specified using square brackets ‘[…]’. For example “::parent::entity.first[1]”.
- Parameters:
rssScopedNameInclMembers – [in] Reference to a string object containing the relative or absolute scoped entity name consisting of zero or more parents and one entity name all separated with the scope separator ‘::’. The name must not be empty.
- Returns:
On success, return a const variant structure with the value belonging to the requested value node. On failure, a const variant is returned that is initialized with 0 using the boolean data type (the first type and first value).
-
virtual uint64_t GetId() const override#
Get the entity ID. Overload of IEntityInfo::GetId.
- Returns:
Returns the entity ID.
-
inline virtual bool ForwardDeclaration() const override#
Is the entity defined as (forward) declaration only? Overload of IEntityInfo::ForwardDeclaration.
- Returns:
Returns whether this entity class instance is defined as forward declaration.
-
inline virtual bool IsRootEntity() const#
Is this definition a root entity?
The root entity is not expecting curly brackets ‘{…}’.
- Returns:
Returns whether this entity is the root entity (which is not the case).
-
inline virtual bool IsExtendable() const#
Is the entity extendable (can multiple definitions at the same scope exist and do they extend each other)?
The default implementation doesn’t allow extending the entity.
- Returns:
Returns whether the entity is extendable (which is not the case).
-
inline virtual bool SupportsChildren() const#
Does the entity support children?
The default implementation doesn’t allow children.
- Returns:
Returns whether the entity supports children (which is not the case).
-
std::pair<std::string, CEntityPtr> ProcessScopedName(bool bNoSearchError = false)#
Process the code for a soped name (a name composed of identifiers and scope operators).
- Parameters:
bNoSearchError – [in] When set, do not throw exception during search to an entity with the name.
- Returns:
Returns a pair object with the first element the scoped name and the second element a pointer to the found entity. In case the object doesn’t exists, returns a nullptr as second element.
-
std::pair<std::string, CEntityPtr> ProcessScopedName(const CTokenList &rlstExpression, bool bNoSearchError = false) const#
Process the code for a soped name (a name composed of identifiers and scope operators).
- Parameters:
rlstExpression – [in] Reference to the token list holding the expression.
bNoSearchError – [in] When set, do not throw exception during search to an entity with the name.
- Returns:
Returns a pair object with the first element the scoped name and the second element a pointer to the found entity. In case the object doesn’t exists, returns a nullptr as second element.
Protected Functions
-
CEntity(CParser &rParser, const CContextPtr &rptrContext)#
Root entity constructor (name is ‘root’ and no parent).
- Parameters:
rParser – [in] Reference to the parser.
rptrContext – [in] Reference to the smart pointer holding the parse context. Must not be NULL.
-
CToken GetToken()#
Get a token from the parser with moving the current position.
- Returns:
Returns the token.
-
CToken GetLastValidToken() const#
Get the last valid token.
- Returns:
Returns the last read token or an empty token when no token was read before.
-
CToken PeekToken(size_t nIndex = 0)#
Get a token from the parser without moving the current position.
- Parameters:
nIndex – [in] The amount of tokens to skip before returning the token.
- Returns:
Returns the token.
-
void PrependToken(CToken &rToken)#
Insert token for parsing at the front of the parsing list.
- Parameters:
rToken – [in] Reference to token object containing the code to insert.
-
std::pair<CConstVariant, bool> ProcessNumericExpression(const CTokenList &rlstExpression, uint32_t uiPrecedence = 100) const#
Calculate the value based on the precedence of operators.
Parse through the string and calculate a value. Values and arithmetic operators are read and a result is calculated as long as the operator precedence doesn’t undercut the current precedence.
identifiers can be used
operators allowed for floating and fixed point operations: + - / * < <= > >= == !=
operators allowed for integral types: + - / % * & | ^ ~ << >> && || ! > >= < <= == !=
parenthesis are allowed
Operator precedence: +————+————–—+—————————————-—+ | precedence | operators | description | +============+=================+===========================================+ | 0 | ~ ! ( ) defined | Bitwise NOT, logical NOT and parenthesis | +————+————–—+—————————————-—+ | 1 | * / % | Multiplication, division, and remainder | +————+————–—+—————————————-—+ | 2 | + - | Addition and subtraction | +————+————–—+—————————————-—+ | 3 | << >> | Bitwise left shift and right shift | +————+————–—+—————————————-—+ | 4 | < <= > >= | Relational operators | +————+————–—+—————————————-—+ | 5 | == != | Equality operators | +————+————–—+—————————————-—+ | 6 | & | Bitwise AND | +————+————–—+—————————————-—+ | 7 | ^ | Bitwise XOR | +————+————–—+—————————————-—+ | 8 | | | Bitwise OR | +————+————–—+—————————————-—+ | 9 | && | Logical AND | +————+————–—+—————————————-—+ | 10 | || | Logical OR | +————+————–—+—————————————-—+
- Parameters:
rlstExpression – [in] Reference to the expression token list.
uiPrecedence – [in] [in] Current precedence level (default 100).
- Returns:
Returns a pair containing the calculated value and a boolean that indicates whether the result is dynamic. In the latter case, the calculated value will be 0.
-
std::pair<CConstVariant, bool> ProcessStringExpression(const CTokenList &rlstExpression) const#
Process the string expression.
- Parameters:
rlstExpression – [in] Reference to the expression token list.
- Returns:
Returns a pair containing the result string and a boolean that indicates whether the result is dynamic. In the latter case, the result string will be empty.
-
CTypeDeclaration ProcessType(bool bNoSearchError = false)#
Process the code for a type.
- Parameters:
bNoSearchError – [in] When set, does not throw an exception during the search of an entity with the defined name.
- Returns:
The type declaration.
-
void SetName(const std::string &rssName, bool bForwardDeclaration = false, bool bNoInsert = false)#
Set the name of the entity. This function must be called by the derived class and will check for a duplicate name (case insensitive comparison) and registers the entity under its name.
- Parameters:
rssName – [in] String object containing the name of the entity. Cannot be empty.
bForwardDeclaration – [in] When set, the entity is part of forward declaration. When the declaration exists already, this function doesn’t do anything. When it doesn’t exists, the entity is created and marked as declared.
bNoInsert – [in] When set, do not insert the entity in the child map of the parent. Use only when local entities are needed.
-
void ProcessSystemTypeAssignments()#
In case there are any unassigned system type entities, process the entities.
-
virtual void AddChild(CEntityPtr ptrChild)#
Add the child to the children list. Called by CreateChild function.
- Parameters:
ptrChild – [in] Pointer to the child entity to add.
-
virtual std::pair<CEntityPtr, bool> FindLocal(const std::string &rssName, bool bDeclaration) const#
Find the entity locally by looking in the entity children map and the entity children maps of all the chained entities. The search is done case-insensitive.
- Parameters:
rssName – [in] Reference to the string object containing the name of the entity to search for.
bDeclaration – [in] When set, the name belongs to a declaration; otherwise it belongs to a definition. Needed to allow the reuse of names between declarations and definitions.
- Returns:
Returns a pair object containing an entity pointer if the entity exists or a NULL pointer if not as well as a boolean that indicates that the entity was from an inherited entity.
-
CEntityPtr FindMember(const std::string &rssScopedName) const#
Find the member entity by looking at the entity declaration map of the type.
Remark
Only compound entities (struct, union, exception) can have declarations.
- Parameters:
rssScopedName – [in] Name of the entity separated by dots (name.name.name) indicating the declaration within a compound entity.
- Returns:
The declaration entity that is represented by the scoped name or NULL when no entity was found.
-
inline CEntityVector &GetChildrenVector()#
Get the children vector for creation of the iterator.
- Returns:
Returns the reference to the child vector.
Protected Static Functions
-
template<class TEntity, typename ...TParams>
static inline CEntityPtr CreateChild(const CContextPtr &rptrContext, CEntity *pParent, TParams... tParams)# Create a child entity and optionally add it to the list of children.
Remark
The parameters defined by the parameter type TParams must correspond to the parameters needed for the constructor of TEntity minus the compulsory ptrParent parameter.
Remark
The parse context of the child is the same as the parent.
- Template Parameters:
TEntity – The entity class to create. This class must derive from CEntity.
TParams – Zero or more parameter types to use for the constructor of the entity class.
- Parameters:
rptrContext – [in] Reference to the context.
pParent – [in] Pointer to the parent entity.
tParams – [in] Zero or more parameters to use for the constructor of the entity class.
- Returns:
Returns a smart pointer to the entity.
-
class CEntityIterator : public sdv::idl::IEntityIterator, public sdv::IInterfaceAccess#
Entity iterator helper class.
Public Functions
-
CEntityIterator(CEntityVector &rvecEntities)#
Constructor.
- Parameters:
rvecEntities – [in] Reference to the entity vector to create the iterator for.
-
virtual sdv::interface_t GetInterface(sdv::interface_id idInterface) override#
Get access to another interface. Overload of IInterfaceAccess::GetInterface.
- Parameters:
idInterface – [in] The interface id to get access to.
- Returns:
Returns a pointer to the interface or NULL when the interface is not supported.
-
virtual uint32_t GetCount() const override#
Get amount of child entities. Overload of IEntityIterator::GetCount.
- Returns:
Returns the amount of entities in this iterator.
-
virtual sdv::IInterfaceAccess *GetEntityByIndex(uint32_t uiIndex) override#
Get entity at supplied index. Overload of IEntityIterator::GetEntityByIndex.
- Parameters:
uiIndex – [in] Index of the entity to return.
- Returns:
Returns interface pointer to the entity or NULL when the index was too large.
-
CEntityIterator(CEntityVector &rvecEntities)#
-
CContextPtr GetContext() const#