ObjectStore C++ API Reference

os_enum_type

class os_enum_type : public os_type
This class is part of the ObjectStore metaobject protocol, which provides access to ObjectStore schemas. An instance of this class represents a C++ enumeration type. This class is derived from os_type.

The types os_int32 and os_boolean, used throughout this manual, are each defined as a signed 32-bit integer type. The type os_unsigned_int32 is defined as an unsigned 32-bit integer type.

Programs using this class must include <ostore/ostore.hh>, followed by <ostore/coll.hh> (if used), followed by <ostore/mop.hh>.

os_enum_type::create()

static os_enum_type &create(
      const char *name, 
      os_List<os_enumerator_literal*>&
);
Creates an instance of os_enum_type named name. The specified list contains the enumerators of the created enumeration type.

os_enum_type::get_name()

const char *get_name() const;
Returns the name of the specified enumeration. A zero-length string is returned for an anonymous enumeration.

os_enum_type::get_enumerator()

const os_enumerator_literal *get_enumerator(os_int32) const;
Returns the enumerator that names the specified integer. Returns 0 if there is no enumerator with the specified value. If there is more than one enumerator with the specified value, the first one is returned.

os_enum_type::get_enumerators()

os_List<const os_enumerator_literal*> get_enumerators() const;
Returns a list, in declaration order, of the enumerator literals defined by the enumeration.

os_enum_type::get_pragmas()

os_List<os_pragma*> get_pragmas() const;
Returns the pragmas associated with the specified enumeration.

os_enum_type::get_source_position()

void get_source_position (
      const char* &file, 
      os_unsigned_int32 &line
) const;
Returns the source position associated with the specified enumeration.

os_enum_type::set_enumerators()

void set_enumerators(os_List<os_enumerator_literal*>&);
Specifies, in declaration order, the enumerator literals defined by the specified enumeration.

os_enum_type::set_name()

void set_name(const char *);
Sets the name of the specified enumeration.

os_enum_type::set_pragmas()

void set_pragmas(os_List<os_pragma*>);
Sets the pragmas associated with the specified enumeration.

os_enum_type::set_source_position()

void set_source_position(
      const char* file, 
      os_unsigned_int32 line
);
Sets the source position associated with the specified enumeration.



[previous] [next]

Copyright © 1997 Object Design, Inc. All rights reserved.

Updated: 03/31/98 17:25:09