Contains functions to carry out Rounding operations.
Definition at line 66 of file roundrule.h.
typedef std::auto_ptr<RoundRule> OSB_LIB::RoundRule::AutoPtr |
Short-cut for an auto pointer.
For details see quality manual, implementation patterns: Virtual copy construction.
Reimplemented in OSB_LIB::RoundUp, and OSB_LIB::DontRound.
Definition at line 78 of file roundrule.h.
typedef Id<RoundRule> OSB_LIB::RoundRule::Oid |
Supported types of rounding rules.
This value refer to database link: ROUNDRULE_TYPE.ROUNDRULE_ID. RoundRuleFactory::create needs to support it.
Definition at line 86 of file roundrule.h.
OSB_LIB::RoundRule::RoundRule | ( | const Oid & | id | ) | [inline] |
OSB_LIB::RoundRule::RoundRule | ( | const Oid & | id, | |
const std::string & | name, | |||
const std::string & | des | |||
) | [inline] |
virtual OSB_LIB::RoundRule::~RoundRule | ( | ) | [inline, virtual] |
AutoPtr OSB_LIB::RoundRule::clone | ( | ) | const |
Virtual copy construction.
For details see quality manual, implementation patterns.
Reimplemented in OSB_LIB::RoundUp, and OSB_LIB::DontRound.
virtual RoundRule* OSB_LIB::RoundRule::clone_ | ( | ) | const [private, pure virtual] |
Internal virtual copy constructor.
For details see quality manual, implementation patterns.
Implemented in OSB_LIB::RoundUp, and OSB_LIB::DontRound.
const std::string& OSB_LIB::RoundRule::des | ( | ) | const [inline] |
const R * OSB_LIB::RoundRule::isa | ( | R *& | ptr | ) | const |
R * OSB_LIB::RoundRule::isa | ( | R *& | ptr | ) |
Downcast to a derived class.
The function uses dynamic_cast<R*> to downcast an object of RoundRule to an object of a derived class.
ptr = dynamic_cast<R*>();
return ptr;
An usage example is given below:
void foo(const RoundRule& rr) { ... RoundUp* pRup; if (0 != rr.isa(pRup)) { // work with pRup } }
ptr | Pointer to cast to. It gets the result of the downcast. It's value will be 0 if the cast fails. |
Definition at line 496 of file roundrule.h.
const std::string& OSB_LIB::RoundRule::name | ( | ) | const [inline] |
const Oid& OSB_LIB::RoundRule::oid | ( | ) | const [inline] |
Performs the rounding.
Implemented in OSB_LIB::RoundUp, and OSB_LIB::DontRound.
Referenced by round().
Explicit form of the rounding operation. Calls operator().
Definition at line 104 of file roundrule.h.
References operator()().
void OSB_LIB::RoundRule::setDes | ( | const std::string & | des | ) |
Set the object's description.
void OSB_LIB::RoundRule::setName | ( | const std::string & | name | ) |
Set the object's name.
std::string OSB_LIB::RoundRule::des_ [private] |
Oid OSB_LIB::RoundRule::id_ [private] |
std::string OSB_LIB::RoundRule::name_ [private] |