Graphitti
A toolkit/software architecture to ease creating high-performance neural network simulators
Loading...
Searching...
No Matches
ParameterManager Class Reference

Public Member Functions

 ~ParameterManager ()=default
 Utility Methods.
 
 ParameterManager (const ParameterManager &parameterManager)=delete
 Delete copy and move methods to avoid copy instances of the singleton.
 
ParameterManageroperator= (const ParameterManager &parameterManager)=delete
 
 ParameterManager (ParameterManager &&parameterManager)=delete
 
ParameterManageroperator= (ParameterManager &&parameterManager)=delete
 
static ParameterManagergetInstance ()
 Get Instance method that returns a reference to this object.
 
bool loadParameterFile (string path)
 
bool getStringByXpath (string xpath, string &referenceVar)
 Interface methods for simulator objects.
 
bool getIntByXpath (string xpath, int &referenceVar)
 
bool getDoubleByXpath (string xpath, double &referenceVar)
 
bool getFloatByXpath (string xpath, float &referenceVariable)
 
bool getBGFloatByXpath (string xpath, BGFLOAT &referenceVar)
 
bool getLongByXpath (string xpath, long &referenceVar)
 
bool getIntVectorByXpath (const string &path, const string &elementName, vector< int > &referenceVar)
 
bool getFileByXpath (const string &path, ifstream &file)
 

Detailed Description

Definition at line 37 of file ParameterManager.h.

Member Function Documentation

◆ getBGFloatByXpath()

bool ParameterManager::getBGFloatByXpath ( string xpath,
BGFLOAT & referenceVar )

Interface method to pull a BGFLOAT value from the xml schema. The calling object must know the xpath to retrieve the value.

This method is a wrapper to run the correct calls based on how BGFLOAT is defined for the simulator. (For multi-threaded usage, floats are used due to register size on GPUs, and double usage is available for single-threaded CPU instances.)

Parameters
xpathThe xpath for the desired float value in the XML file
referenceVarThe variable to store the float result into
Returns
bool A T/F flag indicating whether the retrieval succeeded

Definition at line 219 of file ParameterManager.cpp.

◆ getDoubleByXpath()

bool ParameterManager::getDoubleByXpath ( string xpath,
double & referenceVar )

Interface method to pull a double value from the xml schema. The calling object must know the xpath to retrieve the value.

Parameters
xpathThe xpath for the desired double value in the XML file
referenceVarThe variable to store the double result into
Returns
bool A T/F flag indicating whether the retrieval succeeded

Definition at line 150 of file ParameterManager.cpp.

◆ getFileByXpath()

bool ParameterManager::getFileByXpath ( const string & path,
ifstream & file )

Load the file indicated by the given string path into the ifstream object.

Parameters
paththe path to the XML element containing the file name
fileifstream object were file will be loaded
Returns
true if the retrieval was successful, false otherwise

Definition at line 310 of file ParameterManager.cpp.

◆ getFloatByXpath()

bool ParameterManager::getFloatByXpath ( string xpath,
float & referenceVariable )

Interface method to pull a float value from the xml schema. The calling object must know the xpath to retrieve the value.

Parameters
xpathThe xpath for the desired float value in the XML file
referenceVariableThe variable to store the float result into
Returns
bool A T/F flag indicating whether the retrieval succeeded

Definition at line 182 of file ParameterManager.cpp.

◆ getInstance()

ParameterManager & ParameterManager::getInstance ( )
static

Get Instance method that returns a reference to this object.

Definition at line 44 of file ParameterManager.cpp.

◆ getIntByXpath()

bool ParameterManager::getIntByXpath ( string xpath,
int & referenceVar )

Interface method to pull an integer value from the xml schema. The calling object must know the xpath to retrieve the value.

Parameters
xpathThe xpath for the desired int value in the XML file
referenceVarThe variable to store the int result into
Returns
bool A T/F flag indicating whether the retrieval succeeded

Definition at line 111 of file ParameterManager.cpp.

◆ getIntVectorByXpath()

bool ParameterManager::getIntVectorByXpath ( const string & path,
const string & elementName,
vector< int > & referenceVar )

Interface method to pull a list of ints into a vector<int> from the xml schema. The calling object must match the elementName that stores the list. The xml files in the NLists directory name the element by which type of neuron lists is expected.

A - Active Neuron List I - Inhibitory Neuron List P - Probed Neuron List

Parameters
paththe path to the xml file to read from
elementNameThe name of the element that stores the list of ints
referenceVariableThe reference variable to store the list of ints
Returns
bool A T/F flag indicating whether the retrieval succeeded

Definition at line 275 of file ParameterManager.cpp.

◆ getLongByXpath()

bool ParameterManager::getLongByXpath ( string xpath,
long & referenceVar )

Interface method to pull a long value from the xml schema. The calling object must know the xpath to retrieve the value.

Parameters
xpathThe xpath for the desired float value in the XML file
referenceVariableThe variable to store the long result into
Returns
bool A T/F flag indicating whether the retrieval succeeded

Definition at line 238 of file ParameterManager.cpp.

◆ getStringByXpath()

bool ParameterManager::getStringByXpath ( string xpath,
string & referenceVar )

Interface methods for simulator objects.

Interface method to pull a string object from the xml schema. The calling object must know the xpath to retrieve the value.

Parameters
xpathThe xpath for the desired string value in the XML file
referenceVarThe variable to store the string result into
Returns
bool A T/F flag indicating whether the retrieval succeeded

Definition at line 88 of file ParameterManager.cpp.

◆ loadParameterFile()

bool ParameterManager::loadParameterFile ( string path)

Loads the XML file into a TinyXML tree. This is the starting point for all XPath retrieval calls for the client classes to use.

Definition at line 53 of file ParameterManager.cpp.


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