ocean.core.SmartUnion

Template for a union that knows its active field and ensures the active field is read.

Members

Classes

C1
class C1
Undocumented in source.

Functions

callWithActive
void callWithActive(SU smart_union)

Calls the specified callable with the active field of the provided smart-union. If no field is active, does nothing.

Structs

S1
struct S1
Undocumented in source.
SmartUnion
struct SmartUnion(U)

Provides a getter and setter method for each member of U. Additionally an "Active" enumerator and an "active" getter method is provided. The "Active" enumerator members copy the U member names, the values of that members start with 1. The "Active" enumerator has an additional "none" member with the value 0. The "active" getter method returns the "Active" enumerator value of the type currently set in the union -- this may be "none" if the union is in its initial state.

Unions

U1
union U1
Undocumented in source.
U2
union U2
Undocumented in source.
U3
union U3
Undocumented in source.

See Also

ocean.text.formatter.SmartUnion -- for helper functions to format a SmartUnion to a string

Meta

License

Boost Software License Version 1.0. See LICENSE_BOOST.txt for details. Alternatively, this file may be distributed under the terms of the Tango 3-Clause BSD License (see LICENSE_BSD.txt for details).