FREEDM DGI
Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
freedm::broker::CPhysicalTopology Class Reference

Provides the Physical Topology Architecture. More...

#include <CPhysicalTopology.hpp>

Inheritance diagram for freedm::broker::CPhysicalTopology:

Public Types

typedef std::map< std::string, VertexSetAdjacencyListMap
 
typedef std::multimap< VertexPair, std::string > FIDControlMap
 
typedef std::map< std::string, bool > FIDState
 
typedef std::pair< std::string, std::string > VertexPair
 
typedef std::set< std::string > VertexSet
 

Public Member Functions

bool IsAvailable ()
 Returns if the physical topology is available. More...
 
VertexSet ReachablePeers (std::string source, FIDState fidstate)
 Find the reachable peers. More...
 

Static Public Member Functions

static CPhysicalTopologyInstance ()
 Get the singleton instance of this class. More...
 

Private Member Functions

 CPhysicalTopology ()
 Private constructor for the singleton instance. More...
 
void LoadTopology ()
 Load the topology from a file. More...
 
std::string RealNameFromVirtual (std::string vname)
 Gets the realname from the virtual name. More...
 

Private Attributes

AdjacencyListMap m_adjlist
 
bool m_available
 Which edges FIDs control. More...
 
FIDControlMap m_fidcontrol
 Structure of physical layer. More...
 
std::map< std::string, std::string > m_strans
 If a physical topology has been loaded. More...
 

Detailed Description

Provides the physical topology of the power system. It gets read from a file. There is documentation on the wiki.

It's really important that we have this long documentation, even though there is nothing to say that would actually be helpful: look at the only (public) function in this class.

Member Typedef Documentation

typedef std::multimap<VertexPair, std::string> freedm::broker::CPhysicalTopology::FIDControlMap
typedef std::map<std::string, bool> freedm::broker::CPhysicalTopology::FIDState
typedef std::pair< std::string, std::string > freedm::broker::CPhysicalTopology::VertexPair

Constructor & Destructor Documentation

freedm::broker::CPhysicalTopology::CPhysicalTopology ( )
private

CPhysicalTopology::CPhysicalTopology

Description:
Private constructor for the singleton instance
Precondition:
None
Postcondition:
LoadTopology has been called.

Member Function Documentation

CPhysicalTopology & freedm::broker::CPhysicalTopology::Instance ( )
static

CPhysicalTopology::Instance

Description:
Get the singleton instance of this class
bool freedm::broker::CPhysicalTopology::IsAvailable ( )

CPhysicalTopology::IsAvailable

Description:
Indicates whether or not a physical topology is available
Precondition:
None
Postcondition:
None
Returns
True if a physical topology has been successfully loaded.
void freedm::broker::CPhysicalTopology::LoadTopology ( )
private

CPhysicalTopology::LoadTopology

Description:
Load the topology from a file
Precondition:
The topology is correctly specified in a topology config file. The CGlobalConfiguration class has an entry loaded with a working path to the topology file.
Postcondition:
The topology is loaded into the related maps: the adjacency list is loaded into m_adjlist, and the map of which edges FIDs control is loaded into m_fidcontrol.
Returns
None
CPhysicalTopology::VertexSet freedm::broker::CPhysicalTopology::ReachablePeers ( std::string  source,
CPhysicalTopology::FIDState  fidstate 
)
Description:
Find the reachable peers. Performs a BFS on the physical topology starting at a source vertex. Nodes with FID are checked for the status of their FID. If the FID status is unavailable or the FID is open, the edge is considered Broken
Precondition:
A physical topology has been loaded.
Postcondition:
No change to class state.
Returns
A set of UUIDs of hostnames that are still reachable.
Parameters
sourceThe initial vertex to perform BFS from.
fidstatea map that is FID Name -> State. A closed FID is true, an open FID is false. If an FID is open edges it controls are not used.
std::string freedm::broker::CPhysicalTopology::RealNameFromVirtual ( std::string  vname)
private

CPhysicalTopology::RealNameFromVirtual

Description:
Translates a virtual edge name to a real one.
Precondition:
The m_strans member property has been populated (happens as part of the topology loading process)
Postcondition:
Returns the real name of the node in the physical topology.
Returns
The real name of the node in the physical topology. If the node is named by an SST entry, it gives that name. Otherwise it is the virtual name prepended by the VNAME_PREFIX.
Parameters
vnamethe virtual name to look up.

Member Data Documentation

AdjacencyListMap freedm::broker::CPhysicalTopology::m_adjlist
private
bool freedm::broker::CPhysicalTopology::m_available
private
FIDControlMap freedm::broker::CPhysicalTopology::m_fidcontrol
private
std::map<std::string, std::string> freedm::broker::CPhysicalTopology::m_strans
private

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