World Ocean Simulation System (WOSS) library
woss::WossDbCreator Class Referenceabstract

Abstract class that provides the interface of database creator ( Factory object ). More...

#include <woss-db-creator.h>

Inheritance diagram for woss::WossDbCreator:
Inheritance graph
Collaboration diagram for woss::WossDbCreator:
Collaboration graph

Public Member Functions

 WossDbCreator ()=default
 WossDbCreator (const WossDbCreator &copy)=default
 WossDbCreator (WossDbCreator &&tmp)=default
virtual ~WossDbCreator ()=default
WossDbCreatoroperator= (const WossDbCreator &copy)=default
virtual std::unique_ptr< WossDbcreateWossDb () const =0
virtual std::unique_ptr< WossDbCreatorclone () const =0
WossDbCreatorsetDebug (bool flag)
WossDbCreatorsetWossDebug (bool flag)
WossDbCreatorsetDbPathName (const std::string &name)
bool isUsingDebug () const
bool isUsingWossDbDebug () const
std::string getDbPathName () const

Protected Member Functions

virtual bool initializeDb (WossDb &woss_db) const =0

Protected Attributes

bool debug = false
bool woss_db_debug = false
std::string pathname = ""

Detailed Description

Abstract class that provides the interface of database creator ( Factory object ).

WossDbCreator is the prototype of any database creator included in WOSS. It has the tasks of creating and initializing a specific database object, thus abstracting the caller from specific implementation parameters, and the database itself from system specifics (c++ framework, NS-2 framework, NS-3 framework and so on...)

It also provides a Tcl interpreter for NS-2 implementation.

See also
BathyGebcoDbCreator, SedimDeck41DbCreator, SspWoa2005DbCreator, ResTimeArrTxtDbCreator, ResPressureTxtDbCreator

Constructor & Destructor Documentation

◆ WossDbCreator() [1/3]

woss::WossDbCreator::WossDbCreator ( )
default

◆ WossDbCreator() [2/3]

woss::WossDbCreator::WossDbCreator ( const WossDbCreator & copy)
default

References WossDbCreator().

Here is the call graph for this function:

◆ WossDbCreator() [3/3]

woss::WossDbCreator::WossDbCreator ( WossDbCreator && tmp)
default

References WossDbCreator().

Here is the call graph for this function:

◆ ~WossDbCreator()

virtual woss::WossDbCreator::~WossDbCreator ( )
virtualdefault

Member Function Documentation

◆ clone()

virtual std::unique_ptr< WossDbCreator > woss::WossDbCreator::clone ( ) const
pure virtual

Abstract method. Virtual factory method. It is called to clone this WossDbCreator instance. The caller will be the owner of created object, therefore object destruction is his responsibility

Returns
a std::unique_ptr to a properly initialized WossDbCreator object

Implemented in woss::BathyGebcoDbCreator, woss::BathyUtmCsvDbCreator, woss::ResPressureBinDbCreator, woss::ResPressureTxtDbCreator, woss::ResTimeArrBinDbCreator, woss::ResTimeArrTxtDbCreator, woss::SedimDeck41DbCreator, and woss::SspWoa2005DbCreator.

◆ createWossDb()

virtual std::unique_ptr< WossDb > woss::WossDbCreator::createWossDb ( ) const
pure virtual

Abstract method. It is called to create and initialize a WossDb. The caller will be the owner of created object, therefore object destruction is his responsibility

Returns
a std::unique_ptr to a properly initialized WossDb object

Implemented in woss::BathyGebcoDbCreator, woss::BathyUtmCsvDbCreator, woss::ResPressureBinDbCreator, woss::ResPressureTxtDbCreator, woss::ResTimeArrBinDbCreator, woss::ResTimeArrTxtDbCreator, woss::SedimDeck41DbCreator, and woss::SspWoa2005DbCreator.

◆ getDbPathName()

std::string woss::WossDbCreator::getDbPathName ( ) const
inline

References pathname.

◆ initializeDb()

◆ isUsingDebug()

bool woss::WossDbCreator::isUsingDebug ( ) const
inline

References debug.

◆ isUsingWossDbDebug()

bool woss::WossDbCreator::isUsingWossDbDebug ( ) const
inline

References woss_db_debug.

◆ operator=()

WossDbCreator & woss::WossDbCreator::operator= ( const WossDbCreator & copy)
default

References WossDbCreator().

Here is the call graph for this function:

◆ setDbPathName()

WossDbCreator & woss::WossDbCreator::setDbPathName ( const std::string & name)
inline

References pathname, and WossDbCreator().

Referenced by WossUnitTest::testResPressureDb(), and WossUnitTest::testResTimeArrDb().

Here is the call graph for this function:

◆ setDebug()

WossDbCreator & woss::WossDbCreator::setDebug ( bool flag)
inline

References debug, and WossDbCreator().

Here is the call graph for this function:

◆ setWossDebug()

WossDbCreator & woss::WossDbCreator::setWossDebug ( bool flag)
inline

References woss_db_debug, and WossDbCreator().

Here is the call graph for this function:

Member Data Documentation

◆ debug

◆ pathname

◆ woss_db_debug

bool woss::WossDbCreator::woss_db_debug = false
protected

WossDb debug flag binded in Tcl. All objects instantiated will have this flag

Referenced by initializeDb(), isUsingWossDbDebug(), and setWossDebug().


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