OpendTect
7.0
|
Single integer ID with comparison but no automatic conversion. Making a subclass is optional, but recommended when using multiple IntegerID objects at the same time. Subclassing is mandatory when you want a customized undefined value or a different condition for valid values. More...
Public Member Functions | |
IntegerID () | |
IntegerID (IntType nr) | |
virtual | ~IntegerID () |
IntType | asInt () const |
void | fromString (const char *s, IntType defval=Values::Undef< IntType >::val()) |
bool | isUdf () const |
virtual bool | isValid () const |
virtual bool | operator!= (const IntegerID &oth) const |
virtual bool | operator== (const IntegerID &oth) const |
void | set (IntType i) |
void | setUdf () |
BufferString | toString () const |
Static Public Member Functions | |
static IntegerID | get (IntType nr) |
static IntegerID | udf () |
Protected Member Functions | |
virtual IntType | udfVal () const |
Private Attributes | |
IntType | nr_ |
Single integer ID with comparison but no automatic conversion. Making a subclass is optional, but recommended when using multiple IntegerID objects at the same time. Subclassing is mandatory when you want a customized undefined value or a different condition for valid values.
Example:
using ID = IntegerID<od_uint16>;
void dummy( ID id ) { id.set( 666 ); // good id = 666; // error id += 666; // error id.set( id.asInt() + 666 ); // good }
void dummy2() { dummy( ID::get(555) ); // good dummy( 555 ); // error }
class X { X(); ID id_; };
X::X() : id_(ID::get(444)) {} // good X::X() : id_(444) {} // not recommended, but will compile.
<>
|
inlineexplicit |
|
inline |
|
inline |
|
inlinestatic |
|
inline |
|
inlinevirtual |
Reimplemented in Pos::GeomID, SynthID, and DataPackMgrID.
|
inlinevirtual |
|
inlinevirtual |
|
inline |
|
inline |
|
inline |
|
inlineprotectedvirtual |
|
private |
Generated at for the OpendTect seismic interpretation project. Copyright (C): dGB Beheer B.V. 1995-2024