The jmitie namespace that contains all classes related to MITIE. More...
Namespaces | |
namespace | corelib |
The namespace which contains all the core network processes, link and node selectors and link dimensioners. | |
Classes | |
class | Cj_OptionParseFail |
struct | CjLinkSelector_ctor_va_t |
A struct encapsulating the required arguments to the constructor of a CjLinkSelector. More... | |
struct | CjLinkSelector_select_va_t |
A struct encapsulating the required arguments to the selectLink(...) method of a sub-class of CjLinkSelector. More... | |
struct | wheelVal_t |
A general purpose struct to store values for roulette wheel selection. More... | |
class | CjLinkSelector |
The base class for all link selectors. More... | |
struct | CjNetworkDimensioner_ctor_va_t |
A struct encapsulating the required arguments to the constructor of a CjNetworkDimensioner. More... | |
struct | CjNetworkDimensioner_calcw_va_t |
A struct encapsulating the required arguments to the calcWeight(...) method of a sub-class of CjNetworkDimensioner. More... | |
class | CjNetworkDimensioner |
The base class for all link dimensionsers and re-dimensioners. More... | |
struct | CjNetworkProcess_ctor_va_t |
A struct encapsulating the required arguments to the constructor of a CjNetworkProcess. More... | |
struct | CjNetworkProcess_act_va_t |
A struct encapsulating the required arguments to the performAction(...) method of a sub-class of CjNetworkProcess. More... | |
class | CjNetworkProcess |
The base class for all network processes. More... | |
class | CjNetworkProcessException |
class | CjNP_MemoryAllocFail |
class | CjNP_selectionFail |
class | CjNP_parseFail |
class | CjNLTopology |
A class representing the topology of a network layer. More... | |
class | RandomSource |
A functor, created for use in std::shuffle that maps an RNG to a requested range. More... | |
struct | Scoped_autosync_disable |
DEPRECATED : An object to disable and automatically re-enable autosync within a block of code. More... | |
struct | E_CjNLT_Exception |
just an interface to label exceptions that come from CjNLT operations More... | |
class | E_CjNLT_MemoryAllocFail |
class | E_CjNLT_SizeError |
class | E_CjNLT_BoundsError |
class | E_CjNLT_TopologyError |
class | E_CjNLT_RoutingError |
class | E_CjNLT_InternalError |
struct | CjNodeSelector_ctor_va_t |
A struct encapsulating the required arguments to the constructor of a CjNodeSelector. More... | |
struct | CjNodeSelector_select_va_t |
A struct encapsulating the required arguments to the selectNode(...) method of a sub-class of CjNodeSelector. More... | |
class | CjNodeSelector |
The base class for all node selectors. More... | |
class | CjNP_collection |
class | Cj_NotFoundInFactoryException |
Thrown when a requested name is not found in the factory. More... | |
class | Cj_NameCollisionException |
Thrown when one of the class names in the sub-factory being loaded is already registered in the factory. More... | |
class | Cj_SymbolMissingException |
Thrown when the symbol (function name) is missing from the DLL being loaded. More... | |
class | Cj_DLLException |
Thrown when some DLL loading error occurs; e.g. corrupt file. More... | |
class | Cj_FileSystemException |
Thrown when a file system error occurs; e.g. specified search path is a file, not a directory, or DLL file cannot be read. More... | |
class | CjVisitorFactoryEntry |
Represents a sub-factory entry in CjVisitorFactory. An instance of this class contains the function pointers to the factory methods used when creating, destroying and getting information about objects in the sub-factory. CjVisitorFactoryEntry can be initialised with pointers to the factory methods (for static linking), or a filename to a DLL which is to be loaded. More... | |
class | CjVisitorFactory |
Represents an object factory. . More... | |
class | CjNP_LoggableBase |
Typedefs | |
typedef std::pair< std::string, std::string > | optval_t |
typedef void * | DLLHandle_t |
Enumerations | |
enum | throwFlags_t { DONT_THROW = 0L, THROW_ON_MISSING = 1L, THROW_ON_DUPE = (1L << 1), THROW_ON_BADVAL = (1L << 2) } |
Functions | |
std::list< optval_t > | parseOptions (std::string optionString, bool allowDupes=false, bool requireCurlies=true) |
std::string trim(const std::string & s, const std::string & ws = " \r\t\n" ); | |
template<typename Iter > | |
std::list< std::string > | judeanPopularPeoplesFront (const Iter &first, const Iter &last, const std::string drop_delims, const std::string keep_delims) |
throwFlags_t | operator| (throwFlags_t a, throwFlags_t b) |
throwFlags_t | operator& (throwFlags_t a, throwFlags_t b) |
throwFlags_t & | operator|= (throwFlags_t &a, throwFlags_t b) |
throwFlags_t & | operator&= (throwFlags_t &a, throwFlags_t b) |
template<typename FactoryType , typename ContainerType > | |
bool | extractFactoryTypeOption (ContainerType &cont, const FactoryType &factory, typename FactoryType::Visitor_shared_ptr &result, const throwFlags_t flags, const typename FactoryType::VisitorArgumentType &va) |
Searches for, and builds an instance based on, the first instance of an element from a factory. | |
template<typename POD , typename ContainerType > | |
bool | extractPODValueOption (const std::string optionName, ContainerType &cont, POD &result, const POD *const min_val=0, const POD *const max_val=0, const throwFlags_t flags=(THROW_ON_DUPE|THROW_ON_BADVAL)) |
Searches for an option with the specified name and returns the value field as a plain-old-data-type. | |
template<typename ContainerType > | |
bool | extractStringOption (const std::string optionName, ContainerType &cont, std::string &result, const throwFlags_t flags=(THROW_ON_DUPE|THROW_ON_BADVAL)) |
Searches for an option with the specified name and returns the value field as a string type. | |
template<typename ContainerType > | |
bool | extractValuelessOption (const std::string optionName, ContainerType &cont, const throwFlags_t flags=(THROW_ON_DUPE|THROW_ON_BADVAL)) |
template<typename ContainerType , typename RESULT_TYPE > | |
bool | extractValuelessMultiOption (const std::map< std::string, RESULT_TYPE > &options, ContainerType &cont, RESULT_TYPE &result, const throwFlags_t flags=(THROW_ON_DUPE|THROW_ON_BADVAL)) |
template<typename ContainerType > | |
std::string | listOptionNames (const ContainerType &cont) |
template<typename fwdIter > | |
fwdIter | extractUInt (const fwdIter &begin, const fwdIter &end, unsigned int &j) |
CjNLTopology::layercapab_t | operator| (CjNLTopology::layercapab_t a, CjNLTopology::layercapab_t b) |
CjNLTopology::layercapab_t | operator& (CjNLTopology::layercapab_t a, CjNLTopology::layercapab_t b) |
CjNLTopology::layercapab_t & | operator|= (CjNLTopology::layercapab_t &a, CjNLTopology::layercapab_t b) |
CjNLTopology::layercapab_t & | operator&= (CjNLTopology::layercapab_t &a, CjNLTopology::layercapab_t b) |
std::map< unsigned int, unsigned int > | returnDegreeDist (const CjNLTopology &top) |
Returns a map of out-degree to out-degree frequency. | |
std::map< CjNLTopology::WT, unsigned int > | returnDistancesDist (const CjNLTopology &top) |
Returns a map of node pair distance (minimum weight path) to distance frequency. | |
std::map< CjNLTopology::WT, unsigned int > | returnWeightDist (const CjNLTopology &top) |
Returns a map of link weights to link weight frequency. | |
std::string | returnDistancesDump (const CjNLTopology &top, const unsigned int cellWidth, const std::string &rowPrefix, bool blankDiagonal=false) |
Returns a string of the distances matrix. | |
std::string | returnAdjLDump (const CjNLTopology &top, const unsigned int cellWidth, const std::string &rowPrefix) |
Returns the adjacency matrix as a string. | |
std::string | returnWeightsDump (const CjNLTopology &top, const unsigned int cellWidth, const std::string &rowPrefix, bool blankDiagonal=false) |
Returns a string of the full link weights matrix. |
The jmitie namespace that contains all classes related to MITIE.
enum jmitie::throwFlags_t |
The conditions under which the option parsing function will throw - see extract*Option functions
DONT_THROW |
No exceptions are to be thrown on bad options |
THROW_ON_MISSING |
Throw a jmitie::Cj_OptionParseFail if the option is missing |
THROW_ON_DUPE |
Throw a jmitie::Cj_OptionParseFail if the option is appears more than once |
THROW_ON_BADVAL |
Throw a jmitie::Cj_OptionParseFail if the option has a bad value |
bool jmitie::extractFactoryTypeOption | ( | ContainerType & | cont, | |
const FactoryType & | factory, | |||
typename FactoryType::Visitor_shared_ptr & | result, | |||
const throwFlags_t | flags, | |||
const typename FactoryType::VisitorArgumentType & | va | |||
) | [inline] |
Searches for, and builds an instance based on, the first instance of an element from a factory.
This function will take each pair in cont, in turn, and attempt to create an instance in the factory of the option name - va and the second element in the pair are passed to the factory. If successful the instance will be returned in result and no further invocations will be attempted. The value of result will not be overwritten - if it is not null then the function will return false post-condition: on successful parsing the option is removed from cont
cont | a container of string pairs (the first entry is the option name, the second is the value) which are the options to examine - the container must support the forward iterator and the erase method | |
factory | the factory to use when attempting to create an instance | |
result | the shared pointer where to store the newly created object from the factory | |
flags | the conditions under which to throw an exception - see jmitie::throwFlags_t - only THROW_ON_MISSING is considered in this function | |
va | the arguments to pass the factory when creating the object |
Cj_OptionParseFail | if there are any problems parsing the value field or searching for the option name - see flags |
bool jmitie::extractPODValueOption | ( | const std::string | optionName, | |
ContainerType & | cont, | |||
POD & | result, | |||
const POD *const | min_val = 0 , |
|||
const POD *const | max_val = 0 , |
|||
const throwFlags_t | flags = (THROW_ON_DUPE | THROW_ON_BADVAL) | |||
) | [inline] |
Searches for an option with the specified name and returns the value field as a plain-old-data-type.
This function will search for an option with the given name and parse the value to a POD value - bounds checking can be optionally performed, as well as duplicate and missing field checking. post-condition: on successful parsing the option is removed from cont
optionName | The name of the option to be searched for | |
cont | a container of string pairs (the first entry is the option name, the second is the value) which are to be searched for the option name - the container must support the forward iterator and the erase method | |
result | the shared pointer where to store the newly created object from the factory | |
min_val | if not null this points to the minimum value that the parsed option value must be otherwise an exception will be thrown if flags includes THROW_ON_BADVAL, returns false if not. | |
max_val | if not null this points to the maximum value that the parsed option value must be otherwise an exception will be thrown if flags includes THROW_ON_BADVAL, returns false if not. | |
flags | the conditions under which to throw an exception - see jmitie::throwFlags_t - THROW_ON_MISSING THROW_ON_DUPE and THROW_ON_BADVAL are supported here |
boost::bad_lexical_cast | if the value field cannot be parsed to the given POD | |
Cj_OptionParseFail | if there are any problems parsing the value field or searching for the option name - see flags |
bool jmitie::extractStringOption | ( | const std::string | optionName, | |
ContainerType & | cont, | |||
std::string & | result, | |||
const throwFlags_t | flags = (THROW_ON_DUPE | THROW_ON_BADVAL) | |||
) | [inline] |
Searches for an option with the specified name and returns the value field as a string type.
This function will search for an option with the given name and return the string value it is associated with. Duplicate and missing field checking can be performed optionally. post-condition: on successful parsing the option is removed from cont
optionName | The name of the option to be searched for | |
cont | a container of string pairs (the first entry is the option name, the second is the value) which are to be searched for the option name - the container must support the forward iterator and the erase method | |
result | the shared pointer where to store the newly created object from the factory | |
flags | the conditions under which to throw an exception - see jmitie::throwFlags_t - THROW_ON_MISSING THROW_ON_DUPE and THROW_ON_BADVAL are supported here |
boost::bad_lexical_cast | if the value field cannot be parsed to the given POD | |
Cj_OptionParseFail | if there are any problems parsing the value field or searching for the option name - see flags |
std::string jmitie::returnAdjLDump | ( | const CjNLTopology & | top, | |
const unsigned int | cellWidth, | |||
const std::string & | rowPrefix | |||
) |
Returns the adjacency matrix as a string.
top | the topology of whose adjacency list to print | |
cellWidth | the maximum number of characters per cell in the matrix - if this is 0 then a tab is inserted before the value | |
rowPrefix | a string to print before each line in the output |
std::map< unsigned int, unsigned int > jmitie::returnDegreeDist | ( | const CjNLTopology & | top | ) |
Returns a map of out-degree to out-degree frequency.
Returns a map of degree to degree frequency.
result[deg] = freq(deg) where deg is a node out-degree if deg is not found then the out-degree is 0
std::map< CjNLTopology::WT, unsigned int > jmitie::returnDistancesDist | ( | const CjNLTopology & | top | ) |
Returns a map of node pair distance (minimum weight path) to distance frequency.
result[dist] = freq(dist) where dist is the sum of weights long the least-weight path between a node pair
std::string jmitie::returnDistancesDump | ( | const CjNLTopology & | top, | |
const unsigned int | cellWidth, | |||
const std::string & | rowPrefix, | |||
bool | blankDiagonal = false | |||
) |
Returns a string of the distances matrix.
top | the topology of whose distances to print | |
cellWidth | the maximum number of characters per cell in the matrix - if this is 0 then a tab is inserted before the value | |
rowPrefix | a string to print before each line in the output | |
blankDiagonal | if true the values of the diagonal will be output as zero |
std::map< CjNLTopology::WT, unsigned int > jmitie::returnWeightDist | ( | const CjNLTopology & | top | ) |
Returns a map of link weights to link weight frequency.
result[wt] = freq(wt) where wt is the weight of a directional link
std::string jmitie::returnWeightsDump | ( | const CjNLTopology & | top, | |
const unsigned int | cellWidth, | |||
const std::string & | rowPrefix, | |||
bool | blankDiagonal = false | |||
) |
Returns a string of the full link weights matrix.
top | the topology of whose weights to print | |
cellWidth | the maximum number of characters per cell in the matrix - if this is 0 then a tab is inserted before the value | |
rowPrefix | a string to print before each line in the output | |
blankDiagonal | if true the values of the diagonal will be output as zero |