Avro C++
|
Generic container for Avro enum. More...
#include <Generic.hh>
Public Member Functions | |
GenericEnum (const NodePtr &schema) | |
Constructs a generic enum corresponding to the given schema schema , which should be of Avro type enum. | |
const std::string & | symbol (size_t n) |
Returns the symbol corresponding to the cardinal n . | |
size_t | index (const std::string &symbol) const |
Returns the cardinal for the given symbol symbol . | |
size_t | set (const std::string &symbol) |
Set the value for this enum corresponding to the given symbol symbol . | |
void | set (size_t n) |
Set the value for this enum corresponding to the given cardinal n . | |
size_t | value () const |
Returns the cardinal for the current value of this enum. | |
const std::string & | symbol () const |
Returns the symbol for the current value of this enum. |
Generic container for Avro enum.
size_t avro::GenericEnum::index | ( | const std::string & | symbol | ) | const [inline] |
Returns the cardinal for the given symbol symbol
.
If the symbol is not defined for this enum and exception is thrown.
const std::string& avro::GenericEnum::symbol | ( | size_t | n | ) | [inline] |
Returns the symbol corresponding to the cardinal n
.
If the value for n
is not within the limits an exception is thrown.