PARTONS  
PARtonic Tomography Of Nucleon Software
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
PARTONS::DatabaseFileObject Class Referenceabstract

Base class for those representing files in database. More...

Inheritance diagram for PARTONS::DatabaseFileObject:
PARTONS::BaseObject PARTONS::EnvironmentConfiguration PARTONS::Scenario

Public Member Functions

 DatabaseFileObject (const std::string &className)
 Constructor. More...
 
 DatabaseFileObject (const std::string &className, const int indexId, const time_t storeDate, const std::string &filePath, const std::string &hashSum, const std::string &file)
 Constructor. More...
 
 DatabaseFileObject (const DatabaseFileObject &other)
 Copy constructor. More...
 
virtual ~DatabaseFileObject ()
 Destructor. More...
 
virtual std::string toString () const
 Return a pre-formatted characters string for output visualization of class member's values. More...
 
const std::string & getFile () const
 Get reference to DatabaseFileObject::m_file. More...
 
void setFile (const std::string &file)
 Set DatabaseFileObject::m_file. More...
 
const std::string & getHashSum () const
 Get reference to DatabaseFileObject::m_hashSum. More...
 
void setHashSum (const std::string &hashSum)
 Set DatabaseFileObject::m_hashSum. More...
 
time_t getStoreDate () const
 Get DatabaseFileObject::m_storeDate. More...
 
void setStoreDate (time_t storeDate)
 Set DatabaseFileObject::m_storeDate. More...
 
const std::string & getFilePath () const
 Get reference to DatabaseFileObject::m_filePath. More...
 
void setFilePath (const std::string &filePath)
 Set DatabaseFileObject::m_filePath. More...
 
- Public Member Functions inherited from PARTONS::BaseObject
 BaseObject (const std::string &className)
 Constructor. More...
 
virtual ~BaseObject ()
 Default destructor. More...
 
virtual BaseObjectclone () const
 Virtual clone function to allow the factory to clone all derived members object stored in the BaseObjectRegistry. More...
 
virtual void resolveObjectDependencies ()
 Because of the initialization step order of the program, objects are registered in a total random order and some objects depend on others. More...
 
void serialize (ElemUtils::Packet &packet) const
 Used to split a complex C++ object into a concatenation of simple types. More...
 
void unserialize (ElemUtils::Packet &packet)
 Used to rebuild a complex C++ object from a concatenation of simple type. More...
 
bool operator< (const BaseObject &other) const
 Overload of < operator to sort BaseObject object by its indexId value. More...
 
const std::string & getClassName () const
 
unsigned int getObjectId () const
 
int getIndexId () const
 
void setIndexId (int indexId)
 

Protected Member Functions

virtual std::string fillFile () const =0
 Fill file from database. More...
 
- Protected Member Functions inherited from PARTONS::BaseObject
 BaseObject (const BaseObject &other)
 Copy constructor. More...
 
void info (const std::string &functionName, const std::string &message) const
 Print info message into logger. More...
 
void debug (const std::string &functionName, const std::string &message) const
 Print debug message into logger. More...
 
void warn (const std::string &functionName, const std::string &message) const
 Print warning message into logger. More...
 
void errorMissingParameter (const std::string &parameterName) const
 Use in automation process to throw exception when a parameter is missing from the XML scenario file. More...
 

Private Member Functions

void setCryptographicHashService ()
 Set m_pCryptographicHashService pointer. More...
 

Private Attributes

CryptographicHashServicem_pCryptographicHashService
 Pointer to CryptographicHashService. More...
 
time_t m_storeDate
 Time of insertion into the database. More...
 
std::string m_file
 String containing file content. More...
 
std::string m_hashSum
 Hash sum of file content. More...
 
std::string m_filePath
 Path to file. More...
 

Detailed Description

Base class for those representing files in database.

It is the base class for those representing files that can be stored in the database. It provides a set of useful tools for those objects.

Constructor & Destructor Documentation

◆ DatabaseFileObject() [1/3]

PARTONS::DatabaseFileObject::DatabaseFileObject ( const std::string &  className)

Constructor.

Parameters
classNameName of class.

◆ DatabaseFileObject() [2/3]

PARTONS::DatabaseFileObject::DatabaseFileObject ( const std::string &  className,
const int  indexId,
const time_t  storeDate,
const std::string &  filePath,
const std::string &  hashSum,
const std::string &  file 
)

Constructor.

Parameters
classNameName of class.
indexIdUnique id used when object is created from the database, see BaseObject::m_indexId.
storeDateTime of insertion into the database.
filePathPath to file.
hashSumHash sum of file content.
fileString containing file content.

◆ DatabaseFileObject() [3/3]

PARTONS::DatabaseFileObject::DatabaseFileObject ( const DatabaseFileObject other)

Copy constructor.

Parameters
otherObject to be copied.

◆ ~DatabaseFileObject()

PARTONS::DatabaseFileObject::~DatabaseFileObject ( )
virtual

Destructor.

Member Function Documentation

◆ fillFile()

virtual std::string PARTONS::DatabaseFileObject::fillFile ( ) const
protectedpure virtual

Fill file from database.

Returns
String containing file.

Implemented in PARTONS::EnvironmentConfiguration, and PARTONS::Scenario.

◆ getFile()

const std::string & PARTONS::DatabaseFileObject::getFile ( ) const

Get reference to DatabaseFileObject::m_file.

Returns
Requested reference.

◆ getFilePath()

const std::string & PARTONS::DatabaseFileObject::getFilePath ( ) const

Get reference to DatabaseFileObject::m_filePath.

Returns
Requested reference.

◆ getHashSum()

const std::string & PARTONS::DatabaseFileObject::getHashSum ( ) const

Get reference to DatabaseFileObject::m_hashSum.

Returns
Requested reference.

◆ getStoreDate()

time_t PARTONS::DatabaseFileObject::getStoreDate ( ) const

Get DatabaseFileObject::m_storeDate.

Returns
Requested value.

◆ setCryptographicHashService()

void PARTONS::DatabaseFileObject::setCryptographicHashService ( )
private

Set m_pCryptographicHashService pointer.

◆ setFile()

void PARTONS::DatabaseFileObject::setFile ( const std::string &  file)

Set DatabaseFileObject::m_file.

Parameters
fileObject to be set.

◆ setFilePath()

void PARTONS::DatabaseFileObject::setFilePath ( const std::string &  filePath)

Set DatabaseFileObject::m_filePath.

Parameters
filePathObject to be set.

◆ setHashSum()

void PARTONS::DatabaseFileObject::setHashSum ( const std::string &  hashSum)

Set DatabaseFileObject::m_hashSum.

Parameters
hashSumObject to be set.

◆ setStoreDate()

void PARTONS::DatabaseFileObject::setStoreDate ( time_t  storeDate)

Set DatabaseFileObject::m_storeDate.

Parameters
storeDateValue to be set.

◆ toString()

std::string PARTONS::DatabaseFileObject::toString ( ) const
virtual

Return a pre-formatted characters string for output visualization of class member's values.

Returns
a pre-formatted characters string.

Reimplemented from PARTONS::BaseObject.

Reimplemented in PARTONS::Scenario.

Member Data Documentation

◆ m_file

std::string PARTONS::DatabaseFileObject::m_file
mutableprivate

String containing file content.

◆ m_filePath

std::string PARTONS::DatabaseFileObject::m_filePath
private

Path to file.

◆ m_hashSum

std::string PARTONS::DatabaseFileObject::m_hashSum
mutableprivate

Hash sum of file content.

◆ m_pCryptographicHashService

CryptographicHashService* PARTONS::DatabaseFileObject::m_pCryptographicHashService
private

◆ m_storeDate

time_t PARTONS::DatabaseFileObject::m_storeDate
private

Time of insertion into the database.


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