A class that stores a map of mutexes, one for each register address. Each mutex can be locked or unlocked. The lock and unlock functions receive the register address.
More...
|
| bool | lock (std::string reg, bool critic=true) |
| | Receives a string representing a register address. Locks the mutex associated with it. If critic is true, throw exception if can't find register in list.
|
| |
| bool | unlock (std::string reg, bool critic=true) |
| | Receives a string representing a register address. Unlocks the mutex associated with it. If critic is true, throw exception if can't find register in list.
|
| |
| bool | addReg (std::string reg, std::string tag="NoTag", bool critic=true) |
| | Adds a register to the map, initializing a mutex to it.
|
| |
| unsigned int | addRegs (std::list< std::string > regs, bool critic=true) |
| | Calls addReg for each register address of a list of strings.
|
| |
| unsigned int | removeReg (std::string reg, bool critic=true) |
| | Removes a register from the map, destroying it's mutex.
|
| |
| unsigned int | removeRegs (std::list< std::string > regs, bool critic=true) |
| | Calls removeReg for each register address of a list of strings.
|
| |
| RegLockGuard | lockGuard (std::string reg, std::string tag="NoTag") |
| | returns a lock guard object for that register mutex.
|
| |
| | RegMutex (FENRegMap map) |
| | Constructor that uses one register map. It will throw an exception if there are duplicate register addresses.
|
| |
| | RegMutex (std::list< FENRegMap > registers) |
| | Constructor that uses a list of register maps. It will throw an exception if there are duplicate register addresses.
|
| |
| | RegMutex (std::list< std::shared_ptr< FENRegMap > > registers) |
| | Constructor that uses a list of shared pointers to address maps. It will throw an exception if there are duplicate register addresses.
|
| |
|
void | printRegisters () |
| | prints registers and addresses inside internal list. Mostly used for debugging purposes.
|
| |
| | RMMLog (const char *name) |
| | Constructs the RMMLog object with a name for the log.
|
| |
|
| ~RMMLog () |
| | Destructor for the RMMLog object.
|
| |
| void | debug (const char *sender, const char *printer...) |
| | Logs a debug message.
|
| |
| void | info (const char *sender, const char *printer...) |
| | Logs an info message.
|
| |
| void | warn (const char *sender, const char *printer...) |
| | Logs a warning message.
|
| |
| void | error (const char *sender, const char *printer...) |
| | Logs an error message.
|
| |
| void | critical (const char *sender, const char *printer...) |
| | Logs a critical message.
|
| |
| void | logRelay (std::string logLevel, FILE *out) |
| | Relays log output to a specified file for a given log level.
|
| |
| void | getTimestamp (char message[MAX_CHAR_LOG_MESSAGE]) |
| | Retrieves the current timestamp in a formatted string.
|
| |
| void | getLogMask (int *mask) |
| | Gets the current log mask.
|
| |
| void | getLogMask (char *mask) |
| | Gets the current log mask as a string.
|
| |
| rmmStatus | setLogMask (int mask) |
| | Sets the log mask to the given value.
|
| |
| void | setLogTimeout (int milliseconds) |
| | Sets the timeout for logging operations.
|
| |
| void | setFileWriteTimeout (int milliseconds) |
| | Sets the timeout for file write operations.
|
| |
| int | getFailedWrites () |
| | Gets the count of failed write attempts to the log file.
|
| |
| rmmStatus | putMsg (std::string msg) |
| | Store message in a buffer.
|
| |
| rmmStatus | putInfo (const char *sender, std::string msg) |
| | Calls both putMsg and info methods.
|
| |
| rmmStatus | putMsg (const char *message...) |
| | Store message in a buffer.
|
| |
| rmmStatus | putInfo (const char *sender, const char *msg...) |
| | Calls both putMsg and info methods.
|
| |
| rmmStatus | getMsg (std::string *msg) |
| | Get the message stored in object container.
|
| |
| rmmStatus | getLogFilePath (std::string *filePath) |
| | Get filepath to log.
|
| |
| rmmStatus | getLogFilePath (std::string *path, std::string *name) |
| | Retrieves the directory and filename of the log file.
|
| |
| rmmStatus | setLogFilePath (std::string filePath, bool useName=false) |
| | Sets the log file path for the log file.
|
| |
| rmmStatus | setLogFilePath (std::string path, std::string name) |
| | Sets the log file path using a directory and a custom file name.
|
| |
| rmmStatus | setWriteToFile (bool option, char mode='w') |
| | Enable/disable writing to log.
|
| |
A class that stores a map of mutexes, one for each register address. Each mutex can be locked or unlocked. The lock and unlock functions receive the register address.
NOT THREAD SAFE!