Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

CdbSQLCondition Class Reference

A 'physical' condition. More...

#include <CdbSQLCondition.hh>

Inheritance diagram for CdbSQLCondition:

CdbSQLCloneOf< CdbSQLCondition > CdbMySQLCondition List of all members.

Public Member Functions

virtual ~CdbSQLCondition ()
 Destructor.

CdbCPtr< CdbSQLOriginparent () const
 Back link to the parent.

unsigned short id () const
std::string name () const
bool isPartitionable () const
unsigned short clusterId () const
BdbTime created () const
std::string description () const
virtual void dump (const std::string &theIndent="") const
 Print object's contents onto the Standard Output Stream.

virtual void dump (std::ostream &os, const std::string &theIndent="") const
 Print object's contents onto the specified output stream.

virtual CdbStatus modified (BdbTime &theModificationTime, unsigned short thePartitionId=0)=0
 Find when the condition was most recently modified at the specified partition.

virtual CdbStatus find_revision (CdbCPtr< CdbSQLRevision > &thePtr, const std::string &theName, unsigned short thePartitionId=0)=0
 Find a revision by its name in the scope of the condition/partition.

virtual CdbStatus find_revision (CdbCPtr< CdbSQLRevision > &thePtr, const BdbTime &theId, unsigned short thePartitionId=0)=0
 Find a revision by its numeric identifier in the scope of the condition/partition.

virtual CdbStatus topmost_revision_id (BdbTime &theRevisionId, unsigned short thePartitionId=0, bool excludeTopmostRevisionFlag=false)=0
 Find an identifier for the topmost revision in the scope of the condition/partition.

virtual CdbStatus topmost_revision_id (BdbTime &theRevisionId, unsigned short thePartitionId, unsigned short theIncrementId, bool excludeTopmostRevisionFlag=false)=0
 Find an identifier for the topmost revision in an exact scope of the condition/partition/increment.

virtual CdbStatus revisions (std::vector< CdbCPtr< CdbSQLRevision > > &theList, unsigned short thePartitionId=0)=0
 Get a list of all revisions in the scope of the condition/partition.

virtual CdbStatus create_revision (CdbCPtr< CdbSQLRevision > &thePtr, const std::string &theName, const BdbTime &theId, const std::string &theDescription, unsigned short thePartitionId=0, const bool deleteTopmostRevisionFlag=false)=0
 Create a new revision in a scope of a condition/partition.

virtual CdbStatus create_revision (CdbCPtr< CdbSQLRevision > &thePtr, const std::string &theName, const std::string &theDescription, unsigned short thePartitionId=0, const bool deleteTopmostRevisionFlag=false)=0
 Create a new revision in a scope of a condition/partition (auto generate revision identifier).

virtual CdbStatus original_objects (std::vector< CdbCPtr< CdbSQLOriginalObject > > &theList, unsigned short thePartitionId=0, const BdbTime &theBeginInsertionTime=BdbTime::minusInfinity, const BdbTime &theEndInsertionTime=BdbTime::plusInfinity)=0
 Get a list of all 'original' objects in the scope of the condition/partition.

virtual CdbStatus find_visible_object (CdbCPtr< CdbSQLVisibleObject > &thePtr, const BdbTime &theValidityTime, unsigned short thePartitionId=0, const BdbTime &theRevisionId=BdbTime::plusInfinity)=0
 Get a 'visible' object at the specified point of validity time (by revision id).

virtual CdbStatus find_visible_object (CdbCPtr< CdbSQLVisibleObject > &thePtr, const BdbTime &theValidityTime, unsigned short thePartitionId=0, const std::string &theRevisionName="< topmost >")=0
 Get a 'visible' object at the specified point of validity time (by revision name).

virtual CdbStatus visible_objects (std::vector< CdbCPtr< CdbSQLVisibleObject > > &theList, unsigned short thePartitionId=0, const BdbTime &theRevisionId=BdbTime::plusInfinity, const BdbTime &theBeginTime=BdbTime::minusInfinity, const BdbTime &theEndTime=BdbTime::plusInfinity)=0
 Get a list of all 'visible' objects in the scope of the condition/partition/revision.

virtual CdbStatus visible_objects (std::vector< CdbCPtr< CdbSQLVisibleObject > > &theList, unsigned short thePartitionId=0, const std::string &theRevisionName="< topmost >", const BdbTime &theBeginTime=BdbTime::minusInfinity, const BdbTime &theEndTime=BdbTime::plusInfinity)=0
 Get a list of all 'visible' objects in the scope of the condition/partition/revision.

virtual CdbStatus store_object (CdbSQLObjectId &theObjectId, const CdbCPtr< CdbSQLPartition > &thePartitionPtr, const BdbTime &theBeginTime, const BdbTime &theEndTime, const BdbTime &theStoredTime, const std::string &theTypeName, const char *theValue, unsigned int theNumBytes)=0
 Store a new object in the scope of the condition/partition.


Protected Member Functions

 CdbSQLCondition (const CdbCPtr< CdbSQLOrigin > &theParentPtr, unsigned short theId, const std::string &theName, bool isPartitionableFlag, unsigned short theClusterId, const BdbTime &theCreationTime, const std::string &theDescription)
 Normal constructor.

 CdbSQLCondition (const CdbSQLCondition &theOther)
 Copy constructor.


Detailed Description

A 'physical' condition.

This class reresents a 'physical' condition in a scope f an 'origin'.

See also:
class CdbSQLOrigin

Definition at line 30 of file CdbSQLCondition.hh.


Constructor & Destructor Documentation

CdbSQLCondition::CdbSQLCondition const CdbCPtr< CdbSQLOrigin > &    theParentPtr,
unsigned short    theId,
const std::string &    theName,
bool    isPartitionableFlag,
unsigned short    theClusterId,
const BdbTime   theCreationTime,
const std::string &    theDescription
[protected]
 

Normal constructor.

Definition at line 20 of file CdbSQLCondition.cc.

References CdbCPtr< P, CLOSE_POLICY >::isNull().

CdbSQLCondition::CdbSQLCondition const CdbSQLCondition &    theOther [protected]
 

Copy constructor.

The c-tor is available to the current or derived classes. Its original use would be to implement the "deep" clone mechanism.

Definition at line 38 of file CdbSQLCondition.cc.

CdbSQLCondition::~CdbSQLCondition   [virtual]
 

Destructor.

Definition at line 48 of file CdbSQLCondition.cc.


Member Function Documentation

unsigned short CdbSQLCondition::clusterId   const [inline]
 

Definition at line 76 of file CdbSQLCondition.hh.

Referenced by CdbMySQLCondition::create_revision(), dump(), CdbMySQLCondition::modified(), CdbMySQLCondition::original_objects(), CdbMySQLCondition::revisions(), CdbMySQLCondition::store_object(), and CdbMySQLCondition::topmost_revision_id().

virtual CdbStatus CdbSQLCondition::create_revision CdbCPtr< CdbSQLRevision > &    thePtr,
const std::string &    theName,
const std::string &    theDescription,
unsigned short    thePartitionId = 0,
const bool    deleteTopmostRevisionFlag = false
[pure virtual]
 

Create a new revision in a scope of a condition/partition (auto generate revision identifier).

This operation is similar to the one shown above with only one exception - a revision timestamp will be automatically generated using the current time at a moment when the operation will be invoked.

Implemented in CdbMySQLCondition.

virtual CdbStatus CdbSQLCondition::create_revision CdbCPtr< CdbSQLRevision > &    thePtr,
const std::string &    theName,
const BdbTime   theId,
const std::string &    theDescription,
unsigned short    thePartitionId = 0,
const bool    deleteTopmostRevisionFlag = false
[pure virtual]
 

Create a new revision in a scope of a condition/partition.

The operation will use the TOPMOST revision in the specified scope and use it as a blue print for the new revision. The TOPMOST revision itself will stay intact unless the optional "deleteTopmostRevisionFlag" is specified. The latter is required in two cases:

1. when a partition is being closed (PARTITIONABLE conditions only) 2. when an increment of either a partition or a regular cluster is being closed (all types of conditions)

The operation will also make sure that no revision with the specified name and/or identifier existed in the specified scope. Otherwise a usual error status will be returned.

Upon its successfull completion a smart pointer will be initialized to point onto a transient object representing the created revision.

Returns:
the method will return CdbStatus::Success in case of its normal completion

Implemented in CdbMySQLCondition.

BdbTime CdbSQLCondition::created   const [inline]
 

Definition at line 77 of file CdbSQLCondition.hh.

Referenced by CdbMySQLCondition::create_revision(), dump(), CdbMySQLCondition::modified(), and CdbMySQLCondition::revisions().

std::string CdbSQLCondition::description   const [inline]
 

Definition at line 78 of file CdbSQLCondition.hh.

Referenced by dump().

void CdbSQLCondition::dump std::ostream &    os,
const std::string &    theIndent = ""
const [virtual]
 

Print object's contents onto the specified output stream.

Definition at line 65 of file CdbSQLCondition.cc.

References clusterId(), created(), description(), id(), isPartitionable(), name(), and CdbTimeUtils::time2string().

void CdbSQLCondition::dump const std::string &    theIndent = "" const [virtual]
 

Print object's contents onto the Standard Output Stream.

Definition at line 58 of file CdbSQLCondition.cc.

virtual CdbStatus CdbSQLCondition::find_revision CdbCPtr< CdbSQLRevision > &    thePtr,
const BdbTime   theId,
unsigned short    thePartitionId = 0
[pure virtual]
 

Find a revision by its numeric identifier in the scope of the condition/partition.

Implemented in CdbMySQLCondition.

virtual CdbStatus CdbSQLCondition::find_revision CdbCPtr< CdbSQLRevision > &    thePtr,
const std::string &    theName,
unsigned short    thePartitionId = 0
[pure virtual]
 

Find a revision by its name in the scope of the condition/partition.

Implemented in CdbMySQLCondition.

virtual CdbStatus CdbSQLCondition::find_visible_object CdbCPtr< CdbSQLVisibleObject > &    thePtr,
const BdbTime   theValidityTime,
unsigned short    thePartitionId = 0,
const std::string &    theRevisionName = "< topmost >"
[pure virtual]
 

Get a 'visible' object at the specified point of validity time (by revision name).

Implemented in CdbMySQLCondition.

virtual CdbStatus CdbSQLCondition::find_visible_object CdbCPtr< CdbSQLVisibleObject > &    thePtr,
const BdbTime   theValidityTime,
unsigned short    thePartitionId = 0,
const BdbTime   theRevisionId = BdbTime::plusInfinity
[pure virtual]
 

Get a 'visible' object at the specified point of validity time (by revision id).

Implemented in CdbMySQLCondition.

unsigned short CdbSQLCondition::id   const [inline]
 

Definition at line 73 of file CdbSQLCondition.hh.

Referenced by CdbMySQLCondition::create_revision(), dump(), CdbMySQLCondition::modified(), CdbMySQLCondition::original_objects(), CdbMySQLCondition::revisions(), CdbMySQLCondition::store_object(), and CdbMySQLCondition::topmost_revision_id().

bool CdbSQLCondition::isPartitionable   const [inline]
 

Definition at line 75 of file CdbSQLCondition.hh.

Referenced by CdbMySQLCondition::create_revision(), dump(), CdbMySQLCondition::find_visible_object(), CdbMySQLCondition::modified(), CdbMySQLCondition::original_objects(), CdbMySQLCondition::revisions(), CdbMySQLCondition::store_object(), CdbMySQLCondition::topmost_revision_id(), and CdbMySQLCondition::visible_objects().

virtual CdbStatus CdbSQLCondition::modified BdbTime   theModificationTime,
unsigned short    thePartitionId = 0
[pure virtual]
 

Find when the condition was most recently modified at the specified partition.

A value of the modification time to be returned by this method is supposed to be calculated as the maximum from the 'stored' time of the last 'original' interval and the 'create' time of the most recently created revision.

Implemented in CdbMySQLCondition.

std::string CdbSQLCondition::name   const [inline]
 

Definition at line 74 of file CdbSQLCondition.hh.

Referenced by dump().

virtual CdbStatus CdbSQLCondition::original_objects std::vector< CdbCPtr< CdbSQLOriginalObject > > &    theList,
unsigned short    thePartitionId = 0,
const BdbTime   theBeginInsertionTime = BdbTime::minusInfinity,
const BdbTime   theEndInsertionTime = BdbTime::plusInfinity
[pure virtual]
 

Get a list of all 'original' objects in the scope of the condition/partition.

Implemented in CdbMySQLCondition.

CdbCPtr< CdbSQLOrigin > CdbSQLCondition::parent   const
 

Back link to the parent.

Definition at line 52 of file CdbSQLCondition.cc.

Referenced by CdbMySQLCondition::create_revision(), CdbMySQLCondition::modified(), CdbMySQLCondition::original_objects(), CdbMySQLCondition::revisions(), CdbMySQLCondition::store_object(), and CdbMySQLCondition::topmost_revision_id().

virtual CdbStatus CdbSQLCondition::revisions std::vector< CdbCPtr< CdbSQLRevision > > &    theList,
unsigned short    thePartitionId = 0
[pure virtual]
 

Get a list of all revisions in the scope of the condition/partition.

Implemented in CdbMySQLCondition.

virtual CdbStatus CdbSQLCondition::store_object CdbSQLObjectId   theObjectId,
const CdbCPtr< CdbSQLPartition > &    thePartitionPtr,
const BdbTime   theBeginTime,
const BdbTime   theEndTime,
const BdbTime   theStoredTime,
const std::string &    theTypeName,
const char *    theValue,
unsigned int    theNumBytes
[pure virtual]
 

Store a new object in the scope of the condition/partition.

The operation (if successfull) will also return an identifier of the stored object.

Parameters:
theObjectId  an identifier to be returned
thePartitionPtr  must be non-null for partitionable condition
theTypeName  a type name to be stored along an object
theValue  an object payload
theNumBytes  to be stored

Implemented in CdbMySQLCondition.

virtual CdbStatus CdbSQLCondition::topmost_revision_id BdbTime   theRevisionId,
unsigned short    thePartitionId,
unsigned short    theIncrementId,
bool    excludeTopmostRevisionFlag = false
[pure virtual]
 

Find an identifier for the topmost revision in an exact scope of the condition/partition/increment.

Unlike the previous method this one will narrow its search within the specified scope only.

Implemented in CdbMySQLCondition.

virtual CdbStatus CdbSQLCondition::topmost_revision_id BdbTime   theRevisionId,
unsigned short    thePartitionId = 0,
bool    excludeTopmostRevisionFlag = false
[pure virtual]
 

Find an identifier for the topmost revision in the scope of the condition/partition.

The 'topmost' means a revision with highest numeric identifier in the scope of any increment of the partition. The search will start with the topmost one unless the optional "excludeTopmostRevisionFlag" is set to "true".

NOTE: That for closed partitions of partitionable conditions the returned identifier can not be equal to +Infinity.

If no partition is found then the method would return CdbStatus::NotFound.

Implemented in CdbMySQLCondition.

virtual CdbStatus CdbSQLCondition::visible_objects std::vector< CdbCPtr< CdbSQLVisibleObject > > &    theList,
unsigned short    thePartitionId = 0,
const std::string &    theRevisionName = "< topmost >",
const BdbTime   theBeginTime = BdbTime::minusInfinity,
const BdbTime   theEndTime = BdbTime::plusInfinity
[pure virtual]
 

Get a list of all 'visible' objects in the scope of the condition/partition/revision.

NOTE: Visible validity intervals of the very first and very last found objects can be adjusted to fit into an optionally specified validity subrange.

Implemented in CdbMySQLCondition.

virtual CdbStatus CdbSQLCondition::visible_objects std::vector< CdbCPtr< CdbSQLVisibleObject > > &    theList,
unsigned short    thePartitionId = 0,
const BdbTime   theRevisionId = BdbTime::plusInfinity,
const BdbTime   theBeginTime = BdbTime::minusInfinity,
const BdbTime   theEndTime = BdbTime::plusInfinity
[pure virtual]
 

Get a list of all 'visible' objects in the scope of the condition/partition/revision.

NOTE: Visible validity intervals of the very first and very last found objects can be adjusted to fit into an optionally specified validity subrange.

Implemented in CdbMySQLCondition.


The documentation for this class was generated from the following files:
Generated on Mon Dec 5 18:22:26 2005 for CDB by doxygen1.3-rc3