NAP
Public Types | Public Member Functions | Public Attributes | List of all members
PathElement Class Reference

#include <rtti/path.h>

Public Types

enum  Type { INVALID, ATTRIBUTE, ARRAY_ELEMENT }
 

Public Member Functions

bool operator== (const PathElement &lhs) const
 
bool operator!= (const PathElement &lhs) const
 

Public Attributes

Type mType = Type::INVALID
 
union {
   struct {
      const char *   Name
 
   }   Attribute
 
   struct {
      int   Index
 
   }   ArrayElement
 
}; 
 

Description

Represents an element on a Path. Each element is of a specific type and has different data, depending on the type of the element. In order to be able to have an array (without dynamic allocs) of these elements, it makes use of an anonymous union to store the data. Then, depending on the type of the element, you can access the data through Element.Attribute or Element.ArrayElement.

Note: this class should be used through Path, not directly

Member Enumeration Documentation

◆ Type

enum Type
strong

The type of this element

Enumerator
INVALID 
ATTRIBUTE 
ARRAY_ELEMENT 

Member Function Documentation

◆ operator!=()

bool operator!= ( const PathElement lhs) const

Inequality operator

◆ operator==()

bool operator== ( const PathElement lhs) const

Equality operator

Member Data Documentation

◆ @5

union { ... }

◆ ArrayElement

struct { ... } ArrayElement

◆ Attribute

struct { ... } Attribute

◆ Index

int Index

◆ mType

◆ Name

const char* Name