Template Class CDefEntityContext#
Defined in File definition_generator_base.h
Nested Relationships#
Nested Types#
Class Documentation#
-
template<typename TDerivedContext>
class CDefEntityContext# Definition stream context.
- Template Parameters:
TDerivedContext – The derived context class. Must be deriving from this class.
Public Functions
-
CDefEntityContext(const CGenContext &rContext, sdv::IInterfaceAccess *pEntity)#
Constructor assigning the generator context.
- Parameters:
rContext – [in] Reference to the context to assign.
pEntity – [in] Pointer to the definition entity this context belongs to.
-
CDefEntityContext(CDefEntityContext &rcontext, sdv::IInterfaceAccess *pEntity)#
Copy constructor assigning a new definition entity.
- Parameters:
rcontext – [in] Original context to copy from.
pEntity – [in] Pointer to the definition entity this context belongs to.
-
virtual ~CDefEntityContext()#
Virtual destructor allowing the destruction of derived class members as well.
-
virtual TDerivedContext &operator<<(const TDerivedContext &rContext)#
Join a context into this context.
- Parameters:
rContext – [in] Reference to the context to join.
- Returns:
Reference to this context containing the joined result.
-
std::string GetScope() const#
Return the scope of the members of the definition entity (which is the scoped name of the definition).
- Returns:
The scope if existing or empty if not.
-
bool IsCompound() const#
Current scope part of compound structure?
- Returns:
Returns whether the current structure is part of a compound structure.
-
bool IsStructural() const#
Is this definition structural (struct, exception, union)?
- Returns:
Returns whether the definition is structural.
-
std::string GetIndent(bool bDefBody = true, bool bFuncImpl = false) const#
Get the stored indentation.
- Parameters:
bDefBody – [in] When set, the indentation is for the definition body, keeping the deep indentation flag in consideration.
bFuncImpl – [in] When set, the indentation is for the function implementation, increasing the indentation.
- Returns:
The current indentation.
-
void IncrIndent()#
Enable (if not enabled) and increase the indentation.
-
void DecrIndent()#
Enable (if not enabled) and decrease the indentation (if possible).
-
void DisableIndent()#
Disable the indentation if enabled.
-
void EnableIndent()#
Enable the indentation if disabled.
-
void EnableDeepIndent()#
Enable deep indentation (one more indentation in definition part).
-
sdv::IInterfaceAccess *GetDefEntity() const#
Get the interface to the definition entity.
- Returns:
The interface to the definition or NULL when the context is representing the root definition.
-
template<typename TInterface>
TInterface *GetDefEntity() const# Templated function for getting an interface to the definition entity.
- Template Parameters:
TInterface – The interface to get.
- Returns:
Pointer to the interface or NULL when the definition is not available or doesn::t expose the interface.
-
SIterator CreateIterator()#
Create a new iterator object and make it current.
Remark
The iterator object is deleted automatically when out of scope or when explicitly triggered to release the iterator.
- Returns:
The iterator object.
-
uint32_t GetCurrentIteration()#
Get the iteration value of the current iterator.
- Returns:
The value of the current iteration or 0 when no iterator was created.
Assign a switch variable context to the definition containing the switch variable.
- Parameters:
rptrSwitchVarContext – [in] Reference to the smart pointer holding the context structure for the switch variable.
Create or get a switch code context for the switch variable supplied.
- Template Parameters:
TSwitchCodeContext – Type of switch code context structure. Must derive from SSwitchCodeContext.
- Parameters:
rssSwitchVarName – [in] Reference to the scoped member name of the switch variable including array brackets.
rptrSwitchVar – [in] Reference to the smart pointer holding the switch variable context.
rvecArrayIndices – [in] Reference to the iterator information of any arrays being part of the switch variable name.
- Returns:
Returns a shared pointer to an existing or a new switch code context.
-
bool HasMultipleSwitchCodeContexts() const#
Are multiple switch code contexts available?
- Returns:
Returns whether more than one switch code contexts are available.
Get a vector with all the switch code contexts.
- Template Parameters:
TSwitchCodeContext – Type of switch code context structure. Must derive from SSwitchCodeContext.
- Parameters:
rssScopedSwitchVar – [in] Reference to the string containing the scoped variable name that should be used as a filter. If not set, all contexts are returned.
- Returns:
Returns a vector with the stored switch code contexts.
Public Members
- friend SIterator
Allow the iterator structure to access member variables.
-
struct SIterator#
Iterator structure (used for entity iteration).
Public Functions
-
SIterator(const SIterator &rsIterator) = delete#
No copy constructor.
- Parameters:
rsIterator – [in] Reference to the itertor to copy from.
-
SIterator(SIterator &&rsIterator)#
Move constructor.
- Parameters:
rsIterator – [in] Reference to the itertor to move from.
-
~SIterator()#
Destructor.
-
void Release()#
Releases the iterator.
-
SIterator &operator++()#
Increase the iteration value by 1.
- Returns:
Returns reference to the iterator object after incrementation.
-
uint32_t operator++(int iVal)#
Increase the iteration value by 1.
- Parameters:
iVal – [in] Value is ignored.
- Returns:
Returns the iteration value before incrementation.
-
operator uint32_t() const#
Get the current iteration value.
- Returns:
The iteration index.
Public Members
- friend CDefEntityContext< TDerivedContext >
The context class is allowed to access content directly.
-
SIterator(const SIterator &rsIterator) = delete#