Avro C++

Public Member Functions | List of all members
avro::GenericEnum Class Reference

Generic container for Avro enum. More...

`#include <GenericDatum.hh>`

Inheritance diagram for avro::GenericEnum:

## Public Member Functions
| GenericEnum (const NodePtr &schema)
| Constructs a generic enum corresponding to the given schema `schema`, which should be of Avro type enum.
| GenericEnum (const NodePtr &schema, const std::string &symbol)
const std::string & | symbol (size_t n)
| Returns the symbol corresponding to the cardinal `n`. More...
size_t | index (const std::string &symbol) const
| Returns the cardinal for the given symbol `symbol`. More...
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.
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.

## Detailed Description

Generic container for Avro enum.

## Member Function Documentation

## ◆ index()

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.

## ◆ symbol()

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.

The documentation for this class was generated from the following file:

- api/GenericDatum.hh