ObjectStore C++ API Reference

os_member_variable

class os_member_variable : public os_member
This class is part of the ObjectStore metaobject protocol, which provides access to ObjectStore schemas. Instances of this class represent data members. os_member_variable is derived from os_member.

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_member_variable::create()

static os_member_variable &create(
      const char *name,
      os_type *value_type
);
Creates an os_member_variable. The arguments specify the initial values for the attributes name and value_type. The initial values for the remaining attributes are as follows:
AttributeValue
storage_classos_member_variable::Regular
is_field0
is_static0
is_persistent0

os_member_variable::get_name()

const char *get_name() const;
Returns the name of the specified member.

os_member_variable::get_type()

const os_type &get_type() const;
Returns a reference to a const os_type, the value type of the specified member.

os_type &get_type();
Returns a reference to a non-const os_type, the value type of the specified member.

os_member_variable::get_size()

os_unsigned_int32 get_size() const;
Returns the size in bytes occupied by the specified member. Signals err_mop if the specified member is an os_field_member_variable.

os_member_variable::get_offset()

os_unsigned_int32 get_offset() const;
Returns the offset in bytes of the specified member within its defining class. Signals err_mop if the specified member is an os_field_member_variable, or is a static or persistent member.

os_member_variable::get_source_position()

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

os_member_variable::get_storage_class()

enum os_storage_class { Regular, Persistent, Static } ;
os_storage_class get_storage_class() const;
Returns an enumerator indicating the storage class of the specified member: os_member_variable::Regular, os_member_variable::Persistent, or os_member_variable::Static.

os_member_variable::is_field()

os_boolean is_field() const;
Returns 1 if and only if the specified member is an os_field_member_variable.

os_member_variable::is_static()

os_boolean is_static() const;
Returns 1 if and only if the specified member is a static data member.

os_member_variable::is_persistent()

os_boolean is_persistent() const;
Returns 1 if and only if the specified member is a persistent data member.

os_member_variable::operator const os_field_member_variable&()

operator const os_field_member_variable&() const;
Provides for safe casts from const os_member_variable to const os_field_member_variable&. If the cast is not permissible, err_mop_illegal_cast is signaled.

os_member_variable::operator const os_relationship_member_variable&()

operator const os_relationship_member_variable&() const;
Provides for safe casts from const os_member_variable to const os_relationship_member_variable&. If the cast is not permissible, err_mop_illegal_cast is signaled.

os_member_variable::operator os_field_member_variable&()

operator os_field_member_variable&();
Provides for safe casts from os_member_variable to os_field_member_variable&. If the cast is not permissible, err_mop_illegal_cast is signaled.

os_member_variable::operator os_relationship_member_variable&()

operator os_relationship_member_variable&();
Provides for safe casts from os_member_variable to os_relationship_member_variable&. If the cast is not permissible, err_mop_illegal_cast is signaled.

os_member_variable::set_name()

void set_name(const char *);
Specifies the name of the specified member. ObjectStore copies the character array pointed to by the argument.

os_member_variable::set_offset()

void set_offset(os_unsigned_int32);
Sets the offset in bytes of the specified member within its defining class. Signals err_mop if the specified member is an os_field_member_variable, or is a static or persistent member.

os_member_variable::set_source_position()

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

os_member_variable::set_storage_class()

void set_storage_class(os_unsigned_int32);
Specifies an enumerator indicating the storage class of the specified member: os_member_variable::Regular, os_member_variable::Persistent, or os_member_variable::Static.

os_member_variable::set_type()

set_type(os_type &);
Specifies the value type of the specified member.



[previous] [next]

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

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