|
libzypp
9.1.2
|
Base class for objects providing a numeric Id. More...
#include <ProvideNumericId.h>
Public Member Functions | |
| _NumericIdType | numericId () const |
Protected Member Functions | |
| ProvideNumericId () | |
| Default ctor. | |
| ProvideNumericId (const ProvideNumericId &) | |
| Copy ctor. | |
| ProvideNumericId & | operator= (const ProvideNumericId &) |
| Assign. | |
| ~ProvideNumericId () | |
| Dtor. | |
| ProvideNumericId (const void *const ) | |
| No-Id ctor (0). | |
Static Private Member Functions | |
| static _NumericIdType | nextId () |
| Provide the next Id to use. | |
Private Attributes | |
| const _NumericIdType | _numericId |
Base class for objects providing a numeric Id.
The ctor creates a NumericId from some static counter.
The only assertion is that 0 is not used as an Id, unless the derived class explicitly requests this by using ProvideNumericId( const void *const ).
Why should you want to use 0 as an Id? E.g if your class provides some (singleton) No-object. Might be desirable to make the No-object have No-Id.
struct Foo : public base::ProvideNumericId<Foo,unsigned> {}; Foo foo; foo.numericId(); // returns foo's NumericId.
Definition at line 45 of file ProvideNumericId.h.
| zypp::base::ProvideNumericId< _Derived, _NumericIdType >::ProvideNumericId | ( | ) | [inline, protected] |
Default ctor.
Definition at line 54 of file ProvideNumericId.h.
| zypp::base::ProvideNumericId< _Derived, _NumericIdType >::ProvideNumericId | ( | const ProvideNumericId< _Derived, _NumericIdType > & | ) | [inline, protected] |
Copy ctor.
Definition at line 58 of file ProvideNumericId.h.
| zypp::base::ProvideNumericId< _Derived, _NumericIdType >::~ProvideNumericId | ( | ) | [inline, protected] |
Dtor.
Definition at line 65 of file ProvideNumericId.h.
| zypp::base::ProvideNumericId< _Derived, _NumericIdType >::ProvideNumericId | ( | const void * | const | ) | [inline, protected] |
No-Id ctor (0).
Explicitly request Id 0. Use it with care!
Definition at line 71 of file ProvideNumericId.h.
| _NumericIdType zypp::base::ProvideNumericId< _Derived, _NumericIdType >::numericId | ( | ) | const [inline] |
Definition at line 49 of file ProvideNumericId.h.
Referenced by zypp::operator<<().
| ProvideNumericId& zypp::base::ProvideNumericId< _Derived, _NumericIdType >::operator= | ( | const ProvideNumericId< _Derived, _NumericIdType > & | ) | [inline, protected] |
Assign.
Definition at line 62 of file ProvideNumericId.h.
| static _NumericIdType zypp::base::ProvideNumericId< _Derived, _NumericIdType >::nextId | ( | ) | [inline, static, private] |
Provide the next Id to use.
Definition at line 76 of file ProvideNumericId.h.
const _NumericIdType zypp::base::ProvideNumericId< _Derived, _NumericIdType >::_numericId [private] |
Definition at line 83 of file ProvideNumericId.h.
Referenced by zypp::base::ProvideNumericId< TraceCAD< _Tp >, unsigned long >::numericId().
1.7.6.1