ChimeraTK-DeviceAccess  03.18.00
ChimeraTK::DeviceInfoMap Class Reference

#include <DeviceInfoMap.h>

+ Collaboration diagram for ChimeraTK::DeviceInfoMap:

Classes

class  DeviceInfo
 Stores information about one device. More...
 
class  ErrorList
 Stores information about errors and warnings. More...
 

Public Types

using iterator = std::vector< DeviceInfo >::iterator
 
using const_iterator = std::vector< DeviceInfo >::const_iterator
 

Public Member Functions

bool check (ErrorList &err, ErrorList::ErrorElem::TYPE level)
 Checks logical correctness of DMAP file. More...
 
void getDeviceInfo (const std::string &deviceName, DeviceInfo &value)
 Returns information about specified device. More...
 
size_t getSize ()
 Returns number of records in DMAP file. More...
 
iterator begin ()
 Return iterator to first device described in DMAP file. More...
 
const_iterator begin () const
 
iterator end ()
 Return iterator to element after last one in DMAP file. More...
 
const_iterator end () const
 
std::vector< std::string > getPluginLibraries ()
 You can define shared libraries with Backend plugins in the DMAP file. More...
 
void addPluginLibrary (const std::string &soFile)
 Add the name of a library to the list. More...
 
 DeviceInfoMap (std::string fileName)
 Constructor. More...
 
void insert (const DeviceInfo &elem)
 Insert new element read from DMAP file. More...
 

Protected Attributes

std::vector< DeviceInfo_deviceInfoElements
 vector storing parsed contents of DMAP file More...
 
std::string _dmapFileName
 name of DMAP file More...
 
std::vector< std::string > _pluginLibraries
 Names of the so files with the plugins. More...
 

Friends

std::ostream & operator<< (std::ostream &os, const DeviceInfoMap &deviceInfoMap)
 

Detailed Description

 @brief  Provides container to store information about devices described

in DMAP file.

 Stores detailed information about all devices described in DMAP file.
 Provides functionality like searching for detailed information about
 device and checking for DMAP file correctness. Does not perform DMAP

file parsing

Definition at line 25 of file DeviceInfoMap.h.

Member Typedef Documentation

◆ const_iterator

Definition at line 61 of file DeviceInfoMap.h.

◆ iterator

Definition at line 60 of file DeviceInfoMap.h.

Constructor & Destructor Documentation

◆ DeviceInfoMap()

ChimeraTK::DeviceInfoMap::DeviceInfoMap ( std::string  fileName)
explicit

Constructor.

Initialize DMAP file name stored into object but does not perform DMAP file parsing

Parameters
fileNamename of DMAP file

Definition at line 14 of file DeviceInfoMap.cc.

Member Function Documentation

◆ addPluginLibrary()

void ChimeraTK::DeviceInfoMap::addPluginLibrary ( const std::string &  soFile)

Add the name of a library to the list.

Definition at line 147 of file DeviceInfoMap.cc.

◆ begin() [1/2]

DeviceInfoMap::iterator ChimeraTK::DeviceInfoMap::begin ( )

Return iterator to first device described in DMAP file.

Returns
iterator to first element in DMAP file

Definition at line 139 of file DeviceInfoMap.cc.

+ Here is the caller graph for this function:

◆ begin() [2/2]

const_iterator ChimeraTK::DeviceInfoMap::begin ( ) const

◆ check()

bool ChimeraTK::DeviceInfoMap::check ( DeviceInfoMap::ErrorList err,
ErrorList::ErrorElem::TYPE  level 
)

Checks logical correctness of DMAP file.

Checks if names in DMAP file are unique. Errors are not reported if two devices with the same name have the same parameters. Checks only syntactic correctness of data stored in DMAP file. Syntax and lexical analizys are performed by DMAP file parser.

Parameters
errlist of detected errors
levellevel of checking - if ERROR is selected only errors will be reported, if WARNING is selected errors and warning will be reported
Returns
false if error or warning was detected, otherwise true

Definition at line 58 of file DeviceInfoMap.cc.

+ Here is the caller graph for this function:

◆ end() [1/2]

DeviceInfoMap::iterator ChimeraTK::DeviceInfoMap::end ( )

Return iterator to element after last one in DMAP file.

Returns
iterator to element after last one in DMAP file

Definition at line 143 of file DeviceInfoMap.cc.

+ Here is the caller graph for this function:

◆ end() [2/2]

const_iterator ChimeraTK::DeviceInfoMap::end ( ) const

◆ getDeviceInfo()

void ChimeraTK::DeviceInfoMap::getDeviceInfo ( const std::string &  deviceName,
DeviceInfo value 
)

Returns information about specified device.

Exceptions
exDmapFile[exLibMap::EX_NO_DEVICE_IN_DMAP_FILE] - no device with specified name
Parameters
deviceNamename of the device
valuedetailed information about device taken from DMAP file

Definition at line 36 of file DeviceInfoMap.cc.

+ Here is the caller graph for this function:

◆ getPluginLibraries()

std::vector< std::string > ChimeraTK::DeviceInfoMap::getPluginLibraries ( )

You can define shared libraries with Backend plugins in the DMAP file.

Definition at line 151 of file DeviceInfoMap.cc.

◆ getSize()

size_t ChimeraTK::DeviceInfoMap::getSize ( )

Returns number of records in DMAP file.

Returns
number of records in DMAP file

Definition at line 16 of file DeviceInfoMap.cc.

+ Here is the caller graph for this function:

◆ insert()

void ChimeraTK::DeviceInfoMap::insert ( const DeviceInfo elem)

Insert new element read from DMAP file.

Parameters
elemelement describing detailes of one device taken from DMAP file

Definition at line 32 of file DeviceInfoMap.cc.

+ Here is the caller graph for this function:

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  os,
const DeviceInfoMap deviceInfoMap 
)
friend

Definition at line 20 of file DeviceInfoMap.cc.

Member Data Documentation

◆ _deviceInfoElements

std::vector<DeviceInfo> ChimeraTK::DeviceInfoMap::_deviceInfoElements
protected

vector storing parsed contents of DMAP file

Definition at line 196 of file DeviceInfoMap.h.

◆ _dmapFileName

std::string ChimeraTK::DeviceInfoMap::_dmapFileName
protected

name of DMAP file

Definition at line 197 of file DeviceInfoMap.h.

◆ _pluginLibraries

std::vector<std::string> ChimeraTK::DeviceInfoMap::_pluginLibraries
protected

Names of the so files with the plugins.

Definition at line 198 of file DeviceInfoMap.h.


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