44 using lumiera::error::LUMIERA_ERROR_FATAL;
45 using lumiera::error::LUMIERA_ERROR_CAPACITY;
58 uint _create_count = 0;
67 virtual ~
Base() =
default;
68 virtual void confess() =0;
90 ~
DD() { _checksum -= ii; }
95 memset (&buff_,
'*', ii);
97 memcpy (&buff_, sym, min (ii, strlen (sym)));
105 cout <<
"DD<" << ii <<
">: " << buff_ << endl;
113 D42Sub (
string s1,
string s2)
114 :
DD<42> ((s1+
' '+s2).c_str())
120 cout <<
"I'm special, " << buff_ << endl;
165 CHECK (1 == _create_count);
166 CHECK (0 == _checksum);
169 buff.create<DD<5>>();
174 CHECK (0 == buff->id_);
175 CHECK (4 == _create_count);
180 using Handle = Buffer::Handle;
182 Handle plantingHandle{buff};
183 plantingHandle.emplace (std::move (DD<9>{
"I'm fine"}));
187 CHECK (9 == _checksum);
190 Handle copyHandle = plantingHandle;
192 CHECK (9 == buff->id_);
194 CHECK (0 == buff->id_);
201 copyHandle.create<D42Sub> (
"what the f**",
"is going on here?");
205 CHECK (8 == _create_count);
206 CHECK (42 == _checksum);
208 CHECK (0 == _checksum);
Generic opaque reference counting handle, for accessing a service and managing its lifecycle...
Types marked with this mix-in may be moved but not copied.
#define VERIFY_ERROR(ERROR_ID, ERRONEOUS_STATEMENT)
Macro to verify that a statement indeed raises an exception.
Implementation namespace for support and library code.
Derived specific exceptions within Lumiera's exception hierarchy.
Token or Atom with distinct identity.
Mix-Ins to allow or prohibit various degrees of copying and cloning.
const size_t _ALIGNMENT_OVERHEAD_
maximum additional storage maybe wasted due to alignment of the contained object within OpaqueHolder'...
Simple test class runner.
Tiny helper functions and shortcuts to be used everywhere Consider this header to be effectively incl...
Helper allowing type erasure while holding the actual object inline.
A collection of frequently used helper functions to support unit testing.
Buffer to place and maintain an object instance privately within another object.