class os_member_variable : public os_memberThis 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>.
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:
Attribute | Value |
---|---|
storage_class | os_member_variable::Regular |
is_field | 0 |
is_static | 0 |
is_persistent | 0 |
os_member_variable::get_name()
const char *get_name() const;Returns the name of the specified member.
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_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_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.
void get_source_position( const char* &file, os_unsigned_int32 &line ) const;Returns the source position associated with the specified member.
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_boolean is_field() const;Returns 1 if and only if the specified member is an os_field_member_variable.
os_boolean is_static() const;Returns 1 if and only if the specified member is a static data member.
os_boolean is_persistent() const;Returns 1 if and only if the specified member is a persistent data member.
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.
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.
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.
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.
void set_name(const char *);Specifies the name of the specified member. ObjectStore copies the character array pointed to by the argument.
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.
void set_source_position( const char* file, os_unsigned_int32 line );Sets the source position associated with the specified member.
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.
set_type(os_type &);Specifies the value type of the specified member.
Updated: 03/31/98 17:25:09