Feel++ 0.111.0-preview.14
Finite Element Embedded Library in C++
Feel::JournalManager Class Reference

JournalManager that manage the journal system handles all journalWatchers. More...

+ Inheritance diagram for Feel::JournalManager:
+ Collaboration diagram for Feel::JournalManager:

Public Types

using notify_type = nl::json
 
 JournalManager ()
 Constructor. More...
 
virtual ~JournalManager ()=default
 Destructor.
 
static void setJournalFilename (const std::string &name)
 Setters. More...
 
static void setJournalAutoMode (bool b)
 Set the journal mode. More...
 
static void setJournalEnable (bool m)
 Activate or deactivate the journal.
 
static const std::string & journalFilename ()
 Getters. More...
 
static nl::json & journalData ()
 
static const bool journalAutoMode ()
 Get the current journal mode status. More...
 
static const bool journalEnabled ()
 Get the journal status. More...
 
static const uint32_type journalCurrentCheckpoint ()
 Get the current checkpoint counter. More...
 
static decltype(auto) journalSignal ()
 Get the journal underlying static signal. More...
 
static notify_type const & journalPull ()
 Journal gather/save. More...
 
static void journalSave (std::string const &filename="")
 Save the global property tree into a json file.
 
static void journalCheckpoint (bool save=true, const std::string &filename="")
 Generate a checkpoint. More...
 
static void journalFinalize ()
 Create the journal.
 
static void journalSetDBName (const std::string &dbname="feelpp")
 Setters. More...
 
static void journalSetDBHost (const std::string &host="localhost")
 Set the mongodb host.
 
static void journalSetDBUsername (const std::string &user="")
 Set the mongodb user name.
 
static void journalSetDBPassword (const std::string &password="")
 Set the mongodb user password.
 
static void journalSetDBPort (const std::string &port="27017")
 Set the mongodb port.
 
static void journalSetDBAuthsrc (const std::string &authsrc="admin")
 Set the collection used to authenticate.
 
static void journalSetDBCollection (const std::string &dbname="journal")
 Set mongodb collection to use for the journal.
 
static void journalDBConfig (const MongoConfig &mc)
 Set mongodb collection to use for the journal.
 

Detailed Description

JournalManager that manage the journal system handles all journalWatchers.

See also
JournalManager JournalWatcher Environment

Constructor & Destructor Documentation

◆ JournalManager()

Feel::JournalManager::JournalManager ( )

Constructor.

Default constructor This constructor create a new signal waiting for called 'journalManager'. journalWatcher object connect a specific slot to this signal.

See also
JournalWatcher

Member Function Documentation

◆ journalAutoMode()

static const bool Feel::JournalManager::journalAutoMode ( )
static

Get the current journal mode status.

Returns
true in automatic mode.

◆ journalCheckpoint()

void Feel::JournalManager::journalCheckpoint ( bool  save = true,
const std::string &  filename = "" 
)
static

Generate a checkpoint.

Parameters
saveenable intermediate save.
filenamename of the intermediate file to save in. The filename "journal" is overwritten by default. Use journalCurrentCheckpoint to add an index to the files.
See also
journalCurrentCheckpoint

Referenced by journalSetDBName().

◆ journalCurrentCheckpoint()

static const uint32_type Feel::JournalManager::journalCurrentCheckpoint ( )
static

Get the current checkpoint counter.

Returns
the counter value.

◆ journalEnabled()

static const bool Feel::JournalManager::journalEnabled ( )
static

Get the journal status.

Returns
true if journal is enabled.

Referenced by Feel::JournalWatcher::journalConnect(), and Feel::JournalWatcher::journalFinalize().

◆ journalFilename()

static const std::string & Feel::JournalManager::journalFilename ( )
static

Getters.

Get the journal filename (no ext).

◆ journalPull()

static notify_type const & Feel::JournalManager::journalPull ( )
static

Journal gather/save.

Fetch and merge notifications coming from all observed objects.

Returns
The global journal property tree.
See also
JournalWatcher

◆ journalSetDBName()

static void Feel::JournalManager::journalSetDBName ( const std::string &  dbname = "feelpp")
static

Setters.

Set the mongodb database name.

References journalCheckpoint(), and setJournalEnable().

◆ journalSignal()

static decltype(auto) Feel::JournalManager::journalSignal ( )
static

Get the journal underlying static signal.

Returns

◆ setJournalAutoMode()

static void Feel::JournalManager::setJournalAutoMode ( bool  b)
static

Set the journal mode.

Parameters
bautomatic mode true or false.

◆ setJournalFilename()

static void Feel::JournalManager::setJournalFilename ( const std::string &  name)
static

Setters.

Set JSON file name.

Parameters
namethe file name.