Browse Source

namespace tidy snfLOGmgr

master
Pete McNeil 4 years ago
parent
commit
82afa2f8fb
1 changed files with 7 additions and 7 deletions
  1. 7
    7
      snfLOGmgr.hpp

+ 7
- 7
snfLOGmgr.hpp View File

private: private:
cd::Mutex BufferControlMutex; // Protects buffers while swapping. cd::Mutex BufferControlMutex; // Protects buffers while swapping.
cd::Mutex FlushMutex; // Protects flush operations. cd::Mutex FlushMutex; // Protects flush operations.
string myPath; // Where the file should be written.
string BufferA; // Log data buffer A.
string BufferB; // Log data buffer B.
std::string myPath; // Where the file should be written.
std::string BufferA; // Log data buffer A.
std::string BufferB; // Log data buffer B.
bool UseANotB; // Indicates the active buffer. bool UseANotB; // Indicates the active buffer.
bool isDirty; // True if data not yet written. bool isDirty; // True if data not yet written.
bool isBad; // True if last write failed. bool isBad; // True if last write failed.
bool isTimeToStop; // True when shutting down. bool isTimeToStop; // True when shutting down.
bool inAppendMode; // True when in append mode. bool inAppendMode; // True when in append mode.
string& FlushingBuffer() { return ((UseANotB)?BufferA:BufferB); } // Returns the buffer for flushing.
string& PostingBuffer() { return ((UseANotB)?BufferB:BufferA); } // Returns the buffer for posting.
std::string& FlushingBuffer() { return ((UseANotB)?BufferA:BufferB); } // Returns the buffer for flushing.
std::string& PostingBuffer() { return ((UseANotB)?BufferB:BufferA); } // Returns the buffer for posting.
bool isEnabled; // True when this should run. bool isEnabled; // True when this should run.
void myTask(); // Write back thread task. void myTask(); // Write back thread task.


DiscLogger(string N = "UnNamed"); // Constructs and starts the thread. DiscLogger(string N = "UnNamed"); // Constructs and starts the thread.
~DiscLogger(); // Flushes and stops the thread. ~DiscLogger(); // Flushes and stops the thread.


string Path(const string PathName) { // Sets the file path.
std::string Path(const string PathName) { // Sets the file path.
cd::ScopeMutex NewSettings(BufferControlMutex); cd::ScopeMutex NewSettings(BufferControlMutex);
myPath = PathName; myPath = PathName;
return myPath; return myPath;
} }
string Path() { // Returns the file path.
std::string Path() { // Returns the file path.
cd::ScopeMutex DontMove(BufferControlMutex); cd::ScopeMutex DontMove(BufferControlMutex);
return myPath; return myPath;
} }

Loading…
Cancel
Save