![]() |
IPSDK
4_1_0_2
IPSDK : Image Processing Software Development Kit
|
Log message manager for ipsdk libraries. More...
#include <LogMessageManager.h>
Public Member Functions | |
| const std::string & | getLibraryName () const |
| retrieve library name | |
| template<typename EnumT > | |
| bool | existsMessage (const EnumT &messageId) const |
| template member for easy check whether a message is associated to a given id | |
| bool | existsMessage (const std::string &enumTypeStr, ipInt32 messageId) const |
| check whether a message is associated to a given id | |
| template<typename EnumT > | |
| const std::string & | getMessage (const EnumT &messageId) |
| template member for easy retrieve a message given an id More... | |
| const std::string & | getMessage (const std::string &enumTypeStr, ipInt32 messageId) const |
| retrieve a message given an id More... | |
| void | clear () |
| clear all existing messages | |
| template<typename EnumT > | |
| void | removeMessage (const EnumT &messageId) |
| template member for easy remove an existing message More... | |
| void | removeMessage (const std::string &enumTypeStr, ipInt32 messageId) |
| remove an existing message More... | |
| template<typename EnumT > | |
| void | addMessage (const EnumT &messageId, const std::string &messageStr) |
| template member for easy add a new message More... | |
| void | addMessage (const std::string &enumTypeStr, ipInt32 messageId, const std::string &messageStr) |
| add a new message More... | |
| void | readFile (const boost::filesystem::path &msgFilePath, bool bAppend, EnumStringToIntFunc enumStringToIntFunction=boost::lexical_cast< ipInt32, const std::string &>) |
| read messages from a file More... | |
Static Public Member Functions | |
| static LogMessageManager & | getInstance (const std::string &libraryName) |
| retrieve singleton instance of message | |
Protected Types | |
| typedef std::map< ipInt32, std::string > | MessageMap |
| map associating a message id to a string | |
| typedef std::map< std::string, MessageMap > | MessageColl |
| map associating a string (an enumerate typeid) to a MessageMap | |
Protected Member Functions | |
Constructors and destructors | |
| LogMessageManager (const std::string &libraryName) | |
| ~LogMessageManager () | |
Protected Attributes | |
| std::string | _libraryName |
| library name for message manager | |
| MessageColl | _messageColl |
| message map associating ids with corresponding message | |
Friends | |
| template<class T > | |
| void | boost::checked_delete (T *x) BOOST_NOEXCEPT |
Log message manager for ipsdk libraries.
Each library is associated to a singleton instance of this class. Messages are identified by their numerical id.
|
inline |
template member for easy retrieve a message given an id
| ipsdk::IPSDKUtilException | if existsMessage(messageId) == false |
| const std::string& ipsdk::LogMessageManager::getMessage | ( | const std::string & | enumTypeStr, |
| ipInt32 | messageId | ||
| ) | const |
retrieve a message given an id
| ipsdk::IPSDKUtilException | if existsMessage(messageId) == false |
|
inline |
template member for easy remove an existing message
| ipsdk::IPSDKUtilException | if existsMessage(messageId) == false |
| void ipsdk::LogMessageManager::removeMessage | ( | const std::string & | enumTypeStr, |
| ipInt32 | messageId | ||
| ) |
remove an existing message
| ipsdk::IPSDKUtilException | if existsMessage(messageId) == false |
|
inline |
template member for easy add a new message
| ipsdk::IPSDKUtilException | if existsMessage(messageId) == true |
| void ipsdk::LogMessageManager::addMessage | ( | const std::string & | enumTypeStr, |
| ipInt32 | messageId, | ||
| const std::string & | messageStr | ||
| ) |
add a new message
| ipsdk::IPSDKUtilException | if existsMessage(messageId) == true |
| void ipsdk::LogMessageManager::readFile | ( | const boost::filesystem::path & | msgFilePath, |
| bool | bAppend, | ||
| EnumStringToIntFunc | enumStringToIntFunction = boost::lexical_cast< ipInt32, const std::string &> |
||
| ) |
read messages from a file
File must respect following format : enumTypeStr;id;message
| ipsdk::IPSDKUtilException | if file doesn't exists or can't be acccessed |
| ipsdk::IPSDKUtilException | if invalid file format |
| ipsdk::IPSDKUtilException | if read messag id already exits |
1.8.14