64 std::map<std::string, std::unique_ptr<std::mutex>>
nodeMutexes;
Stores and provides lookup access to the controller's in-memory network topology.
Definition Topology.h:18
std::map< std::string, CncNode_t * > nodeLookup
Internal helper for fast lookups. Avoids looping through the vector every time if searching for a nod...
Definition Topology.h:58
std::vector< CncNode_t > nodes
The main database storing all network nodes (Switches/End-Devices). This vector owns the memory of th...
Definition Topology.h:24
CncNode_t * getNode(const std::string &nodeName)
Retrieves a node by its hostname.
Definition Topology.cpp:12
ietfInterface_t * getInterface(const LldpNeighbor_t &neighborInfo)
Retrieves an interface based on LLDP neighbor information.
Definition Topology.cpp:20
std::mutex & getNodeMutex(const std::string &nodeName)
Retrieves a mutex for synchronizing access to a specific node.
Definition Topology.cpp:36
std::map< std::string, std::unique_ptr< std::mutex > > nodeMutexes
Mutexes for synchronizing access to individual nodes. The map is protected by 'mapMutex' to ensure th...
Definition Topology.h:64
void buildIndex()
Creates an index for fast node lookup by hostname Must be called after populating the 'nodes' vector.
Definition Topology.cpp:3
std::mutex mapMutex
Mutex to protect access to the 'nodeMutexes' map when adding new nodes or retrieving mutexes.
Definition Topology.h:69
This struct is used on the CNC side to represent one host with all its interfaces as well as its PTP ...
Definition CncTypes.h:512
Struct that represents the basic information about a system connected to an LLDP-port on a host....
Definition CncTypes.h:223
Struct to hold information about an interface, inspired by the ietf-interfaces yang model.
Definition CncTypes.h:256