sys-sage
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Protected Attributes | List of all members
Component Class Reference

#include <Component.hpp>

Inheritance diagram for Component:
Cache Chip Core Memory Node Storage Subdivision Thread Topology

Public Member Functions

 Component (int _id=0, string _name="unknown", int _componentType=SYS_SAGE_COMPONENT_NONE)
 
 Component (Component *parent, int _id=0, string _name="unknown", int _componentType=SYS_SAGE_COMPONENT_NONE)
 
void InsertChild (Component *child)
 
int InsertBetweenParentAndChild (Component *parent, Component *child, bool alreadyParentsChild)
 
int InsertBetweenParentAndChildren (Component *parent, vector< Component * > children, bool alreadyParentsChild)
 
int RemoveChild (Component *child)
 
void SetParent (Component *parent)
 
void PrintSubtree ()
 
void PrintAllDataPathsInSubtree ()
 
string GetName ()
 
void SetName (string _name)
 
int GetId ()
 
int GetComponentType ()
 
string GetComponentTypeStr ()
 
vector< Component * > * GetChildren ()
 
ComponentGetParent ()
 
ComponentGetChild (int _id)
 
ComponentGetChildById (int _id)
 
ComponentGetChildByType (int _componentType)
 
vector< Component * > GetAllChildrenByType (int _componentType)
 
void GetAllChildrenByType (vector< Component * > *_outArray, int _componentType)
 
ComponentFindSubcomponentById (int _id, int _componentType)
 
ComponentGetSubcomponentById (int _id, int _componentType)
 
void GetAllSubcomponentsByType (vector< Component * > *outArray, int _componentType)
 
vector< Component * > GetAllSubcomponentsByType (int _componentType)
 
int CountAllSubcomponents ()
 
int CountAllSubcomponentsByType (int _componentType)
 
int CountAllChildrenByType (int _componentType)
 
ComponentGetAncestorByType (int _componentType)
 
int GetNumThreads ()
 
int GetSubtreeDepth ()
 
ComponentGetNthAncestor (int n)
 
void GetNthDescendents (vector< Component * > *outArray, int depth)
 
vector< Component * > GetNthDescendents (int depth)
 
void GetSubcomponentsByType (vector< Component * > *outArray, int componentType)
 
vector< Component * > GetSubcomponentsByType (int _componentType)
 
void GetComponentsInSubtree (vector< Component * > *outArray)
 
vector< Component * > GetComponentsInSubtree ()
 
vector< DataPath * > * GetDataPaths (int orientation)
 
DataPathGetDataPathByType (int dp_type, int orientation)
 
void GetAllDataPathsByType (vector< DataPath * > *outDpArr, int dp_type, int orientation)
 
vector< DataPath * > GetAllDataPathsByType (int dp_type, int orientation)
 
int CheckComponentTreeConsistency ()
 Checks the consistency of the component tree starting from this component.
 
int GetTopologySize (unsigned *out_component_size, unsigned *out_dataPathSize)
 
int GetDepth (bool refresh)
 
void DeleteDataPath (DataPath *dp)
 
void DeleteAllDataPaths ()
 
void DeleteSubtree ()
 
void Delete (bool withSubtree=true)
 

Public Attributes

std::map< std::string, void * > attrib
 

Protected Attributes

int id
 
int depth
 
string name
 
int count {-1}
 
const int componentType
 
vector< Component * > children
 
Componentparent { nullptr }
 
vector< DataPath * > dp_incoming
 
vector< DataPath * > dp_outgoing
 

Detailed Description

Generic class Component - all components inherit from this class, i.e. this class defines attributes and methods common to all components.
Therefore, these can be used universally among all components. Usually, a Component instance would be an instance of one of the child classes, but a generic component (instance of class Component) is also possible.

Constructor & Destructor Documentation

◆ Component() [1/2]

Component::Component ( int _id = 0,
string _name = "unknown",
int _componentType = SYS_SAGE_COMPONENT_NONE )

Generic Component constructor (no automatic insertion in the Component Tree). Usually one of the derived subclasses for different Component Types will be created. Sets:

Parameters
_id= id, default 0
_name= name, default "unknown"
_componentType= componentType, default SYS_SAGE_COMPONENT_NONE

◆ Component() [2/2]

Component::Component ( Component * parent,
int _id = 0,
string _name = "unknown",
int _componentType = SYS_SAGE_COMPONENT_NONE )

Generic Component constructor with insertion into the Component Tree as the parent 's child (as long as parent is an existing Component). Usually one of the derived subclasses for different Component Types will be created. Sets:

Parameters
parent= the parent
_id= id, default 0
_name= name, default "unknown"
_componentType= componentType, default SYS_SAGE_COMPONENT_NONE

Member Function Documentation

◆ CheckComponentTreeConsistency()

int Component::CheckComponentTreeConsistency ( )

Checks the consistency of the component tree starting from this component.

This function verifies that each child component has this component set as its parent. It logs an error message for each child that has an incorrect parent and increments the error count. The function then recursively checks the consistency of the entire subtree rooted at each child component.

Returns
The total number of inconsistencies found in the component tree.

The function returns the total number of errors found in the component tree, including errors in the direct children and any nested descendants.

◆ CountAllChildrenByType()

int Component::CountAllChildrenByType ( int _componentType)

Counts number of children matching the requested component type.

Parameters
_componentType- Component type to look for.
Returns
Returns number of children matching the requested component type.

◆ CountAllSubcomponents()

int Component::CountAllSubcomponents ( )

Counts number of subcomponents (children, their children and so on).

Returns
Returns number of subcomponents.

◆ CountAllSubcomponentsByType()

int Component::CountAllSubcomponentsByType ( int _componentType)

Counts number of subcomponents (children, their children and so on) matching the requested component type.

Parameters
_componentType- Component type to look for.
Returns
Returns number of subcomponents matching the requested component type.

◆ Delete()

void Component::Delete ( bool withSubtree = true)

Deletes a component, its children (if withSubtree = true) and all the associated data paths. If only the component itself is deleted, its children are inserted into its parent's children list.

Parameters
withSubtree- if true, the whole subtree is deleted, otherwise only the component itself.

◆ DeleteAllDataPaths()

void Component::DeleteAllDataPaths ( )

Deletes all DataPaths of this component.

◆ DeleteDataPath()

void Component::DeleteDataPath ( DataPath * dp)

Deletes and de-allocates the DataPath pointer from the list(std::vector) of outgoing and incoming DataPaths of the Components.

Parameters
dp- DataPath to Delete

◆ DeleteSubtree()

void Component::DeleteSubtree ( )

Deletes the whole subtree (all the children) of the component.

◆ FindSubcomponentById()

Component * Component::FindSubcomponentById ( int _id,
int _componentType )

OBSOLETE. Use GetSubcomponentById instead. This function will be removed in the future.

◆ GetAllChildrenByType() [1/2]

vector< Component * > Component::GetAllChildrenByType ( int _componentType)

Searches for all the children matching the given component type.

Parameters
_componentType- Required type of components
Returns
A vector of all the children matching the _componentType

◆ GetAllChildrenByType() [2/2]

void Component::GetAllChildrenByType ( vector< Component * > * _outArray,
int _componentType )

Searches for all the children matching the given component type.

Parameters
_componentType- Required type of components
outArray- output parameter (vector with results)
An input is pointer to a std::vector<Component *>, in which the elements will be pushed. It must be allocated before the call (but does not have to be empty).
The method pushes back the found elements – i.e. the elements(pointers) can be found in this array after the method returns. (If no found, nothing will be pushed into the vector.)

◆ GetAllDataPathsByType() [1/2]

vector< DataPath * > Component::GetAllDataPathsByType ( int dp_type,
int orientation )

Retrieves all DataPath * from the list of this component's data paths with matching type and orientation. Results are returned in a vector<DataPath*>*, where first the matching data paths in dp_outgoing are pushed back, then the ones in dp_incoming.

Parameters
dp_type- DataPath type (dp_type) to search for.
orientation- orientation of the DataPath (SYS_SAGE_DATAPATH_OUTGOING or SYS_SAGE_DATAPATH_INCOMING or a logical or of these)
Returns
A std::vector<DataPath*> with the results.

◆ GetAllDataPathsByType() [2/2]

void Component::GetAllDataPathsByType ( vector< DataPath * > * outDpArr,
int dp_type,
int orientation )

Retrieves all DataPath * from the list of this component's data paths with matching type and orientation. Results are returned in vector<DataPath*>* outDpArr, where first the matching data paths in dp_outgoing are pushed back, then the ones in dp_incoming.

Parameters
dp_type- DataPath type (dp_type) to search for.
orientation- orientation of the DataPath (SYS_SAGE_DATAPATH_OUTGOING or SYS_SAGE_DATAPATH_INCOMING or a logical or of these)
outDpArr- output parameter (vector with results)
An input is pointer to a std::vector<DataPath *>, in which the data paths will be pushed. It must be allocated before the call (but does not have to be empty).
The method pushes back the found data paths – i.e. the data paths(pointers) can be found in this array after the method returns. (If no found, the vector is not changed.)

◆ GetAllSubcomponentsByType() [1/2]

vector< Component * > Component::GetAllSubcomponentsByType ( int _componentType)

Searches for all the subcomponents (children, their children and so on) matching the given component type.

Parameters
_componentType- Required type of components.
Returns
A vector of all the subcomponents matching the _componentType.

◆ GetAllSubcomponentsByType() [2/2]

void Component::GetAllSubcomponentsByType ( vector< Component * > * outArray,
int _componentType )

Searches for all the subcomponents (children, their children and so on) matching the given component type.

Parameters
_componentType- Required type of components
outArray- output parameter (vector with results)
An input is pointer to a std::vector<Component *>, in which the elements will be pushed. It must be allocated before the call (but does not have to be empty).
The method pushes back the found elements – i.e. the elements(pointers) can be found in this array after the method returns. (If no found, nothing will be pushed into the vector.)

◆ GetAncestorByType()

Component * Component::GetAncestorByType ( int _componentType)

Moves up the tree until a parent of given type.

Parameters
_componentType- the desired component type
Returns
Component * matching the criteria. NULL if no match found

◆ GetChild()

Component * Component::GetChild ( int _id)

Identical to GetChildById Retrieve a Component* to a child with child.id=_id.
Should there be more children with the same id, the first match will be retrieved (i.e. the one with lower index in the children array.)

See also
GetChildById

◆ GetChildById()

Component * Component::GetChildById ( int _id)

Retrieve a Component* to a child with child.id=_id.
Should there be more children with the same id, the first match will be retrieved (i.e. the one with lower index in the children array.)

◆ GetChildByType()

Component * Component::GetChildByType ( int _componentType)

Retrieve a Component* to a child matching the given component type.
Should there be more children with the same type, the first match will be retrieved (i.e. the one with lower index in the children array.)

◆ GetChildren()

vector< Component * > * Component::GetChildren ( )

Returns a pointer to std::vector containing all children of the component (empty vector if no children) .

Returns
vector<Component *> * with children

◆ GetComponentsInSubtree() [1/2]

vector< Component * > Component::GetComponentsInSubtree ( )

Retrieves a std::vector of Component pointers, which form the subtree (current node and all the subcomponents) of this.

Returns
A std::vector<Component*> with the results.

◆ GetComponentsInSubtree() [2/2]

void Component::GetComponentsInSubtree ( vector< Component * > * outArray)

Retrieves a std::vector of Component pointers, which form the subtree (current node and all the subcomponents) of this.

Parameters
outArray- output parameter (vector with results)
An input is pointer to a std::vector<Component *>, in which the elements will be pushed. It must be allocated before the call (but does not have to be empty).
The method pushes back the found elements – i.e. the elements(pointers) can be found in this array after the method returns. (If no found, the vector is not changed.)

◆ GetComponentType()

int Component::GetComponentType ( )

Returns component type of the component. The component type denotes of which class the instance is (Often the components are stored as Component*, even though they are a member of one of the child classes)
SYS_SAGE_COMPONENT_NONE -> class Component
SYS_SAGE_COMPONENT_THREAD -> class Thread
SYS_SAGE_COMPONENT_CORE -> class Core
SYS_SAGE_COMPONENT_CACHE -> class Cache
SYS_SAGE_COMPONENT_SUBDIVISION -> class Subdivision
SYS_SAGE_COMPONENT_NUMA -> class Numa
SYS_SAGE_COMPONENT_CHIP -> class Chip
SYS_SAGE_COMPONENT_MEMORY -> class Memory
SYS_SAGE_COMPONENT_STORAGE -> class Storage
SYS_SAGE_COMPONENT_NODE -> class Node
SYS_SAGE_COMPONENT_TOPOLOGY -> class Topology

Returns
componentType
See also
componentType

◆ GetComponentTypeStr()

string Component::GetComponentTypeStr ( )

Returns component type in human-readable string.
SYS_SAGE_COMPONENT_NONE -> "None"
SYS_SAGE_COMPONENT_THREAD -> "HW_thread"
SYS_SAGE_COMPONENT_CORE -> "Core"
SYS_SAGE_COMPONENT_CACHE -> "Cache"
SYS_SAGE_COMPONENT_SUBDIVISION -> "Subdivision"
SYS_SAGE_COMPONENT_NUMA -> "NUMA"
SYS_SAGE_COMPONENT_CHIP -> "Chip"
SYS_SAGE_COMPONENT_MEMORY -> "Memory"
SYS_SAGE_COMPONENT_STORAGE -> "Storage"
SYS_SAGE_COMPONENT_NODE -> "Node"
SYS_SAGE_COMPONENT_TOPOLOGY -> "Topology"

Returns
string component type
See also
componentType

◆ GetDataPathByType()

DataPath * Component::GetDataPathByType ( int dp_type,
int orientation )

Retrieves a DataPath * from the list of this component's data paths with matching type and orientation.
The first match is returned – first SYS_SAGE_DATAPATH_OUTGOING are searched, then SYS_SAGE_DATAPATH_INCOMING.

Parameters
dp_type- DataPath type (dp_type) to search for
orientation- orientation of the DataPath (SYS_SAGE_DATAPATH_OUTGOING or SYS_SAGE_DATAPATH_INCOMING or a logical or of these)
Returns
DataPath pointer to the found data path; NULL if nothing found.

◆ GetDataPaths()

vector< DataPath * > * Component::GetDataPaths ( int orientation)

Returns the DataPaths of this component according to their orientation.

Parameters
orientation- either SYS_SAGE_DATAPATH_OUTGOING or SYS_SAGE_DATAPATH_INCOMING
Returns
Pointer to std::vector<DataPath *> with the result (dp_outgoing on SYS_SAGE_DATAPATH_OUTGOING, or dp_incoming on SYS_SAGE_DATAPATH_INCOMING, otherwise NULL)
See also
dp_incoming
dp_outgoing

◆ GetDepth()

int Component::GetDepth ( bool refresh)

Retrieves the depth (level) of a component in the topology.

Parameters
refresh- Boolean value, if true: recalculate the position (depth) of the component in the tree, if false, return the already stored value
Returns
The depth (level) of a component in the topology
See also
depth

◆ GetId()

int Component::GetId ( )

Returns id of the component.

Returns
id
See also
id

◆ GetName()

string Component::GetName ( )

Returns name of the component.

Returns
name
See also
name

◆ GetNthAncestor()

Component * Component::GetNthAncestor ( int n)

Retrieves Nth ancestor, which resides N levels above.
E.g. if n=1, the parent is retrieved; if n=2, the grandparent is retrieved and so on.

Parameters
n- how many levels above the tree should be looked.
Returns
The ancestor residing N levels above.

◆ GetNthDescendents() [1/2]

vector< Component * > Component::GetNthDescendents ( int depth)

Retrieves a std::vector of Component pointers, which reside 'depth' levels deeper. The tree is traversed in order as the children are stored in the std::vector.
E.g. if depth=1, only children of the current are retrieved; if depth=2, only children of the children are retrieved..

Parameters
depth- how many levels down the tree should be looked
Returns
A std::vector<Component*> with the results.

◆ GetNthDescendents() [2/2]

void Component::GetNthDescendents ( vector< Component * > * outArray,
int depth )

Retrieves a std::vector of Component pointers, which reside 'depth' levels deeper. The tree is traversed in order as the children are stored in std::vector children.
E.g. if depth=1, only children of the current are retrieved; if depth=2, only children of the children are retrieved..

Parameters
depth- how many levels down the tree should be looked
outArray- output parameter (vector with results)
An input is pointer to a std::vector<Component *>, in which the elements will be pushed. It must be allocated before the call (but does not have to be empty).
The method pushes back the found elements – i.e. the elements(pointers) can be found in this array after the method returns. (If no found, nothing will be pushed into the vector.)

◆ GetNumThreads()

int Component::GetNumThreads ( )

OBSOLETE. Use int CountAllSubcomponentsByType(SYS_SAGE_COMPONENT_THREAD) instead. Returns the number of Components of type SYS_SAGE_COMPONENT_THREAD in the subtree.

◆ GetParent()

Component * Component::GetParent ( )

Returns Component pointer to parent (or NULL if this component is the root)

◆ GetSubcomponentById()

Component * Component::GetSubcomponentById ( int _id,
int _componentType )

Searches the subtree to find a component with a matching id and componentType, i.e. looks for a certain component with a matching ID. The search is a DFS. The search starts with the calling component.
Returns first occurence that matches these criteria.

Parameters
_id- the id to look for
_componentType- the component type where to look for the id
Returns
Component * matching the criteria. Returns the first match. NULL if no match found

◆ GetSubcomponentsByType() [1/2]

vector< Component * > Component::GetSubcomponentsByType ( int _componentType)

Retrieves a std::vector of Component pointers, which reside in the subtree and have a matching type. The tree is traversed DFS in order as the children are stored in the std::vector.

Parameters
componentType- componentType
Returns
A std::vector<Component*> with the results.

◆ GetSubcomponentsByType() [2/2]

void Component::GetSubcomponentsByType ( vector< Component * > * outArray,
int componentType )

Retrieves a std::vector of Component pointers, which reside in the subtree and have a matching type. The tree is traversed DFS in order as the children are stored in each std::vector children.

Parameters
componentType- componentType
outArray- output parameter (vector with results)
An input is pointer to a std::vector<Component *>, in which the elements will be pushed. It must be allocated before the call (but does not have to be empty).
The method pushes back the found elements – i.e. the elements(pointers) can be found in this array after the method returns. (If no found, the vector is not changed.)

◆ GetSubtreeDepth()

int Component::GetSubtreeDepth ( )

Retrieves maximal distance to a leaf (i.e. the depth of the subtree).
0=leaf, 1=children are leaves, 2=at most children's children are leaves .....

Returns
maximal distance to a leaf

◆ GetTopologySize()

int Component::GetTopologySize ( unsigned * out_component_size,
unsigned * out_dataPathSize )

Calculates approximate memory footprint of the subtree of this element (including the relevant data paths).

Parameters
out_component_size- output parameter (contains the footprint of the component tree elements); an already allocated unsigned * is the input, the value is expected to be 0 (the result is accumulated here)
out_dataPathSize- output parameter (contains the footprint of the data-path graph elements); an already allocated unsigned * is the input, the value is expected to be 0 (the result is accumulated here)
Returns
The total size in bytes

◆ InsertBetweenParentAndChild()

int Component::InsertBetweenParentAndChild ( Component * parent,
Component * child,
bool alreadyParentsChild )

Inserts this component between a parent and one of its children. The parent component remains the parent, this Component becomes a new child of the parent, and the specified child becomes this component's child.

Parameters
parentThe parent component to which this component will be inserted as a child.
childThe child component that will become the child of this component and will remain a descendant of the original parent.
alreadyParentsChildA boolean flag indicating whether this component is already a child of the parent.
If true, the function assumes that this component is already present as a child of the parent and only needs to reassign the specified child.
If false, the function will add this component as a new child of the parent after reassigning the specified child.
Returns
0 on success; 1 if the child and parent are not child and parent in the component tree; 2 if the component tree is corrupt (parent is a parent of child but child is not in the parent's children list); 3 if the component tree is corrupt (parent is not a parent of child but child is in the parent's children list).

◆ InsertBetweenParentAndChildren()

int Component::InsertBetweenParentAndChildren ( Component * parent,
vector< Component * > children,
bool alreadyParentsChild )

Inserts this component between a parent and a (subset of) his children. The parent component remains parent, this Component becomes a new child, and the children become parent's grandchildren.

Parameters
parentThe parent component to which this component will be inserted as a child.
childrenA vector of child components that will become the children of this component and the grandchildren of the original parent.
alreadyParentsChildA boolean flag indicating whether this component is already a child of the parent.
If true, the function assumes that this component is already present as a child of the parent and only needs to reassign the specified children.
If false, the function will add this component as a new child of the parent after reassigning the specified children.
Returns
0 on success
1 on incompatible parent-children components (one or more children are not parent's children);
2 on corrupt component tree (parent is a parent of child but child is NOT in children list of parent);
3 on corrupt component tree (parent is NOT a parent of child but child is in children list of parent)

◆ InsertChild()

void Component::InsertChild ( Component * child)

Inserts a Child component to this component (in the Component Tree). The child pointer will be inserted at the end of std::vector of children (retrievable through GetChildren(), GetChild(int _id) etc.)

Parameters
child- a pointer to a Component (or any class instance that inherits from Component).
See also
GetChildren()
GetChild(int _id)

◆ PrintAllDataPathsInSubtree()

void Component::PrintAllDataPathsInSubtree ( )

Prints to stdout basic information about all DataPaths that go either from or to the components in the subtree.
For each component, all outgoing and incoming DataPaths are printed, i.e. a DataPath may be printed twice.

◆ PrintSubtree()

void Component::PrintSubtree ( )

Prints the whole subtree of this component (including the component itself) to stdout. The tree is printed in DFS order, so that the hierarchy can be easily seen. Each child is indented by " ". For each component in the subtree, the following is printed: "<string component type> (name <name>) id <id> - children: <num children>

◆ RemoveChild()

int Component::RemoveChild ( Component * child)

Removes the passed component from the list of children, without completely deleting (and deallocating) the child itself

Parameters
child- child to remove
Returns
how many elements were deleted (normally, 0 or 1 should be possible)

◆ SetName()

void Component::SetName ( string _name)

Sets name of the component.

Parameters
_name- name of the component
See also
name

◆ SetParent()

void Component::SetParent ( Component * parent)

Define a parent to the component. This is usually used when inserting a component in the tree (by calling InsertChild on the parent, and calling SetParent on the child).

Parameters
parent- a pointer to a Component (or any class instance that inherits from Component).
See also
InsertChild()

Member Data Documentation

◆ attrib

std::map<std::string, void*> Component::attrib

A map for storing arbitrary pieces of information or data.

  • The key denotes the name of the attribute.
  • The value points to the data, stored as a void*.

This data structure is designed to store a wide variety of data types by utilizing pointers to void. Due to its flexibility, it is essential to manage the types and memory allocation/deallocation carefully to avoid issues such as memory leaks or undefined behavior.

Usage:

  1. Adding a new key-value pair:
std::string key = "exampleKey";
int* value = new int(42); // Dynamically allocate memory for the value
attrib[key] = static_cast<void*>(value); // Store the value in the map
std::map< std::string, void * > attrib
Definition Component.hpp:556
  1. Retrieving data from an existing key:
std::string key = "exampleKey";
if (attrib.find(key) != attrib.end()) {
int* retrievedValue = static_cast<int*>(attrib[key]);
std::cout << "Value: " << *retrievedValue << std::endl;
} else {
std::cout << "Key not found." << std::endl;
}
  1. Checking for the existence of a key:
std::string key = "exampleKey";
if (attrib.find(key) != attrib.end()) {
std::cout << "Key exists." << std::endl;
} else {
std::cout << "Key does not exist." << std::endl;
}
  1. Removing a key-value pair and freeing memory:
std::string key = "exampleKey";
if (attrib.find(key) != attrib.end()) {
int* value = static_cast<int*>(attrib[key]);
delete value; // Free the dynamically allocated memory
attrib.erase(key); // Remove the key-value pair from the map
}
  1. Updating the value for an existing key:
std::string key = "exampleKey";
if (attrib.find(key) != attrib.end()) {
int* oldValue = static_cast<int*>(attrib[key]);
delete oldValue; // Free the old value
int* newValue = new int(100); // Allocate new value
attrib[key] = static_cast<void*>(newValue); // Update the map
}

Note:

  • Proper memory management is crucial when using void* pointers. Always ensure that dynamically allocated memory is freed when no longer needed.
  • Type safety is not enforced, so it is important to cast pointers to the correct type when retrieving values from the map.

◆ children

vector<Component*> Component::children
protected

Contains the list (std::vector) of pointers to children of the component in the component tree.

◆ componentType

const int Component::componentType
protected

Component type of the component. The component type denotes of which class the instance is (Often the components are stored as Component*, even though they are a member of one of the child classes)
This attribute is constant, set by the constructor, and READONLY.
SYS_SAGE_COMPONENT_NONE -> class Component
SYS_SAGE_COMPONENT_THREAD -> class Thread
SYS_SAGE_COMPONENT_CORE -> class Core
SYS_SAGE_COMPONENT_CACHE -> class Cache
SYS_SAGE_COMPONENT_SUBDIVISION -> class Subdivision
SYS_SAGE_COMPONENT_NUMA -> class Numa
SYS_SAGE_COMPONENT_CHIP -> class Chip
SYS_SAGE_COMPONENT_MEMORY -> class Memory
SYS_SAGE_COMPONENT_STORAGE -> class Storage
SYS_SAGE_COMPONENT_NODE -> class Node
SYS_SAGE_COMPONENT_TOPOLOGY -> class Topology

◆ count

int Component::count {-1}
protected

Can be used to represent multiple Components with the same properties. By default, it represents only 1 component, and is set to -1.

◆ depth

int Component::depth
protected

Depth (level) of the Component in the Component Tree

◆ dp_incoming

vector<DataPath*> Component::dp_incoming
protected

Contains references to data paths that point to this component.

See also
DataPath

◆ dp_outgoing

vector<DataPath*> Component::dp_outgoing
protected

Contains references to data paths that point from this component.

See also
DataPath

◆ id

int Component::id
protected

Numeric ID of the component. There is no requirement for uniqueness of the ID, however it is advised to have unique IDs at least in the realm of parent's children. Some tree search functions, which take the id as a search parameter search for first match, so the user is responsible to manage uniqueness in the realm of the search subtree (or should be aware of the consequences of not doing so). Component's ID is set by the constructor, and is retrieved via int GetId();

◆ name

string Component::name
protected

Name of the component (as a string).

◆ parent

Component* Component::parent { nullptr }
protected

Contains pointer to the parent component in the component tree. If this component is the root, parent will be NULL.


The documentation for this class was generated from the following files: