#include <CdbSQLObjectId.hh>
Public Types | |
| enum | SchemaType { SCHEMA_REGULAR, SCHEMA_PARTITIONABLE } |
| enum | { INVALID_ORIGIN_ID = 0xFFFF, INVALID_CONDITION_ID = 0xFFFF, INVALID_CLUSTER_ID = 0xFFFF, INVALID_PARTITION_ID = 0xFFFF, INVALID_INCREMENT_ID = 0xFFFF, INVALID_INDEX = 0xFFFFFFFF } |
Public Member Functions | |
| CdbSQLObjectId (unsigned short theOriginId=INVALID_ORIGIN_ID, unsigned short theConditionId=INVALID_CONDITION_ID, SchemaType theSchema=SCHEMA_REGULAR, unsigned short theClusterId=INVALID_CLUSTER_ID, unsigned short thePartitionId=INVALID_PARTITION_ID, unsigned short theIncrementId=INVALID_INCREMENT_ID, unsigned int theIndex=INVALID_INDEX) | |
| Constructor. | |
| unsigned short | origin () const |
| unsigned short | condition () const |
| SchemaType | schema () const |
| unsigned short | cluster () const |
| unsigned short | partition () const |
| unsigned short | increment () const |
| unsigned int | index () const |
| bool | isValid () const |
| Check the status of an address. | |
| std::string | toString () const |
| Get a string representation of the identifier. | |
Static Public Member Functions | |
| CdbSQLObjectId | createRegular (unsigned short theOriginId, unsigned short theConditionId, unsigned short theClusterId, unsigned short theIncrementId, unsigned int theIndex) |
| A factory method for "REGULAR" condition addresses. | |
| CdbSQLObjectId | createPartitionable (unsigned short theOriginId, unsigned short theConditionId, unsigned short theClusterId, unsigned short thePartitionId, unsigned short theIncrementId, unsigned int theIndex) |
| A factory method for "PARTITIONABLE" condition addresses. | |
| bool | fromString (CdbSQLObjectId &theOutId, const std::string &theInString) |
| Translate a string into an object identifier. | |
In general, the address is defined as follows:
---
For the current implementation the full address has the following layout:
16-bit 16-bit 16-bit 16-bit 16-bit 16-bit 32-bit -------- ----------- -------- --------- ----------- ----------- ------- S<origin>------
Where only two address schemes are supported:
=0 corresponds to "REGULAR" conditions. In that case the value of the parameter is ignored.
=1 corresponds to "PARTITIONABLE" conditions.
Object would be printed as (for example):
"L0-125-R-0-0-1-12567" ("REGULAR") "L257-314-P-0-20-1-56" ("PARTITIONABLE")
Definition at line 38 of file CdbSQLObjectId.hh.
|
|
Definition at line 44 of file CdbSQLObjectId.hh. |
|
|
Definition at line 42 of file CdbSQLObjectId.hh. Referenced by fromString(), and schema(). |
|
||||||||||||||||||||||||||||||||
|
Constructor. Note, that by default it will construct an invalid object address. Use schema specific functory methods defined above instead.
Definition at line 128 of file CdbSQLObjectId.hh. Referenced by createPartitionable(), createRegular(), and fromString(). |
|
|
Definition at line 148 of file CdbSQLObjectId.hh. Referenced by CdbMySQL::findPayloadObjectSource(), fromString(), CdbMySQL::setPayloadObjectSource(), and toString(). |
|
|
Definition at line 146 of file CdbSQLObjectId.hh. Referenced by fromString(), and toString(). |
|
||||||||||||||||||||||||||||
|
A factory method for "PARTITIONABLE" condition addresses.
Definition at line 78 of file CdbSQLObjectId.hh. References CdbSQLObjectId(). Referenced by CdbMySQLCondition::store_object(). |
|
||||||||||||||||||||||||
|
A factory method for "REGULAR" condition addresses.
Definition at line 55 of file CdbSQLObjectId.hh. References CdbSQLObjectId(). Referenced by CdbMySQLCondition::store_object(). |
|
||||||||||||
|
Translate a string into an object identifier. The method will make an attempt to translate the specified input string into an identifier. The method will return 'true' and set up an object identifier value upon its successfull completion. NOTE: Returning the 'true' status doesn't really mean that the returned identifier will be valid. It just means that the input string can be translated into an identifier. That because some variants of the identifier objects can not be valid. And the full constructor defined below does allow creating non-valid object.
Definition at line 17 of file CdbSQLObjectId.cc. References CdbSQLObjectId(), cluster(), condition(), increment(), index(), origin(), partition(), schema(), SCHEMA_PARTITIONABLE, SCHEMA_REGULAR, and SchemaType. |
|
|
Definition at line 150 of file CdbSQLObjectId.hh. Referenced by CdbMySQL::findPayloadObjectSource(), fromString(), CdbMySQL::setPayloadObjectSource(), and toString(). |
|
|
Definition at line 151 of file CdbSQLObjectId.hh. Referenced by CdbMySQL::findPayloadObjectSource(), fromString(), CdbMySQL::setPayloadObjectSource(), and toString(). |
|
|
Check the status of an address. An address is considered as a NON-valid one only when all its fileds are constructed using their default values.
Definition at line 161 of file CdbSQLObjectId.hh. References INVALID_CLUSTER_ID, INVALID_CONDITION_ID, INVALID_INCREMENT_ID, INVALID_INDEX, INVALID_ORIGIN_ID, and INVALID_PARTITION_ID. Referenced by CdbRooDb::createObject(), CdbMySQL::findPayloadObjectSource(), CdbMySQL::setPayloadObjectSource(), and toString(). |
|
|
Definition at line 145 of file CdbSQLObjectId.hh. Referenced by CdbMySQL::findPayloadObjectSource(), fromString(), CdbMySQL::setPayloadObjectSource(), and toString(). |
|
|
Definition at line 149 of file CdbSQLObjectId.hh. Referenced by CdbMySQL::findPayloadObjectSource(), fromString(), CdbMySQL::setPayloadObjectSource(), and toString(). |
|
|
Definition at line 147 of file CdbSQLObjectId.hh. References SchemaType. Referenced by CdbMySQL::findPayloadObjectSource(), fromString(), CdbMySQL::setPayloadObjectSource(), and toString(). |
|
|
Get a string representation of the identifier.
Definition at line 84 of file CdbSQLObjectId.cc. References cluster(), condition(), increment(), index(), isValid(), origin(), partition(), schema(), and SCHEMA_REGULAR. Referenced by CdbRooDbObject::id(), and operator<<(). |
1.3-rc3