Avro C++
|
Generic container for unions. More...
#include <GenericDatum.hh>
Public Member Functions | |
GenericUnion (const NodePtr &schema) | |
Constructs a generic union corresponding to the given schema schema , and the given value. More... | |
size_t | currentBranch () const |
Returns the index of the current branch. | |
void | selectBranch (size_t branch) |
Selects a new branch. More... | |
GenericDatum & | datum () |
Returns the datum corresponding to the currently selected branch in this union. | |
const GenericDatum & | datum () const |
Returns the datum corresponding to the currently selected branch in this union. | |
Public Member Functions inherited from avro::GenericContainer | |
const NodePtr & | schema () const |
Returns the schema for this object. | |
Additional Inherited Members | |
Protected Member Functions inherited from avro::GenericContainer | |
GenericContainer (Type type, const NodePtr &s) | |
Constructs a container corresponding to the given schema. | |
Generic container for unions.
|
inlineexplicit |
Constructs a generic union corresponding to the given schema schema
, and the given value.
The schema should be of Avro type union and the value should correspond to one of the branches of the union.
|
inline |
Selects a new branch.
The type for the value is changed accordingly.
branch | The index for the selected branch. |