Object

Base class of all ohymos classes

[ libohymos | Source | Keywords | Summary | Ancestors | All Members | Descendants ]

Quick Index

DESCRIPTION

Class Summary

class Object
{

public:
char* Class_name(void) ;
char* Object_name(void) ;
int Object_number(void) ;
void* Owner(void) ;
Boolean Compare(char* c_name, char* o_name, int o_num);
Boolean Compare(char* o_name, int o_num);
Boolean Compare(Object* obj);
Boolean Set_owner(void* o);
void Cprint(FILE* fp_out, char* head);
void Cprint(FILE* fp_out) ;
void Cprint(char* head ) ;
void Oprint(FILE* fp_out, char* head);
void Oprint(FILE* fp_out) ;
void Oprint(char* head ) ;
void Absname( char* absname );
Boolean Init(char* o_name, int o_num);
Object(char* o_name, int o_num);
Object(void);
~Object(void);
protected:
char* class_name;
char* object_name;
int object_number;
void* owner;
}; // Object

Back to the top of Object


DESCRIPTION

Base class of all ohymos classes. An element of type Object has four basic data members: owner, class_name, object_name, object_number.

Definition of "owner".
When an object A has an object B as its data member, we call A is the owner of B. The data member "owner", a pointer of void*, is the pointer to the owner of the current object.

Definition of "class_name"
class_name stores the name of the class. For example, "classname" of an object of the class Object is "Object".

Definition of "object_name"
object_name stores the name of the objcet. User descides the name of each object.

Definition of "object_number"
object_number stores the identification number.

object_name and object_number are used to identify ohymos elements owned by an ohymos element. Suppose an ohymos element A owns ohymos elements e1, e2, ..., en. Then elements e1, e2, ..., en should be able to be identified by the pair object_name and object_number.

Back to the top of Object


char* class_name;

class_name stores the class name.

  char* class_name;   // class name

Back to the top of Object


char* object_name;

objetc_name stores the object name.

  char* object_name;  // object name

Back to the top of Object


int object_number;

object_number stores the object_number.

  int object_number;  // object number

Back to the top of Object


void* owner;

pointer to the "owner" of the current object casted to type void*

  void* owner;

Back to the top of Object


char* Class_name(void) ;

Returns class_name

  char* Class_name(void)                       
;

Function is currently defined inline.


Back to the top of Object


char* Object_name(void) ;

Returns object_name

  char* Object_name(void)                        
;

Function is currently defined inline.


Back to the top of Object


int Object_number(void) ;

Returns object_number

  int Object_number(void)                          
;

Function is currently defined inline.


Back to the top of Object


void* Owner(void) ;

Returns the pointer to the owner

  void* Owner(void)                  
;

Function is currently defined inline.


Back to the top of Object


Boolean Compare(char* c_name, char* o_name, int o_num);

If the current object has the same triplet as those given by the arguments, this function returns YES. Otherwise, NO.

  Boolean Compare(char* c_name, char* o_name, int o_num);

Back to the top of Object


Boolean Compare(char* o_name, int o_num);

If the current object has the same object_name and object_number as those given as the arguments, this function returns YES. Otherwise, NO.

  Boolean Compare(char* o_name, int o_num);

Back to the top of Object


Boolean Compare(Object* obj);

If the current object has the same triplet as those which *obj has, this function returns YES. Otherwise, NO.

  Boolean Compare(Object* obj);

Back to the top of Object


Boolean Set_owner(void* o);

Set owner to be "o".

When already a different object has been registerd as the owner, you cannot set new owner. If this case happens, Set_owner returns NO.

  Boolean Set_owner(void* o);

Back to the top of Object


void Cprint(FILE* fp_out, char* head);

Print "head", class_name, object_name, object_numer to the file pointer fp_out

  virtual void Cprint(FILE* fp_out, char* head);

Back to the top of Object


void Cprint(FILE* fp_out) ;

Print class_name, object_name, object_numer to the file pointer fp_out

  void Cprint(FILE* fp_out)                            
;

Function is currently defined inline.


Back to the top of Object


void Cprint(char* head ) ;

Print class_name, object_name, object_numer to stderr

  void Cprint(char* head = "    ")                          
;

Function is currently defined inline.


Back to the top of Object


void Oprint(FILE* fp_out, char* head);

Trace back the object's ancestry, that is, prints all the ancesters to a total system to fp_out. "head" is printed before the ancestry.

  virtual void Oprint(FILE* fp_out, char* head);

Back to the top of Object


void Oprint(FILE* fp_out) ;

Prints all the ancesters to a total system to fp_out.

  void Oprint(FILE* fp_out)                            
;

Function is currently defined inline.


Back to the top of Object


void Oprint(char* head ) ;

Prints all the ancesters to a total system to stderr.

  void Oprint(char* head = "    ")                          
;

Function is currently defined inline.


Back to the top of Object


void Absname( char* absname );

Returns the name which specifies the object uniquely through the argument "absname"

"absname" will be created by concatenating

           "absolute name of the owner"
           "/"
           object_name
           "__"
           object_number.
     
When owner == NULL, "absolute name of the owner" is taken as "" (NULL).

Example. Assume that the absolute name of the owner is "/total_sytetem__0", object_name of the current object is "elm_t", and object_number is 0, then "absname" is /total_system__0/elm_t__0

Enough space to store the resultant string should be secured by the caller of Absname.

  void Absname(
    char* absname // the string to store the name
    );

Back to the top of Object


Boolean Init(char* o_name, int o_num);

Set object_name and object_number. o_name is copyed into object_name, and object_number is set to o_num.

  virtual Boolean Init(char* o_name, int o_num);

Back to the top of Object


Object(char* o_name, int o_num);

Constructor. Sets object_name to o_name and object_number to o_name.

  Object(char* o_name, int o_num);

Back to the top of Object


Object(void);

Constructor. Sets class_name to "Object", object_name to NULL, object_number to -1, and owner to NULL.

Normally, just after the object of classes derived from the class Object has been constructed, object_number is equal to -1. So object_number can be used as a marker which shows the object is a just-born baby or not.

  Object(void);

Back to the top of Object


~Object(void);

Destructor

  virtual ~Object(void);

Back to the top of Object


All Members

public:
char* Class_name(void) ;
char* Object_name(void) ;
int Object_number(void) ;
void* Owner(void) ;
Boolean Compare(char* c_name, char* o_name, int o_num);
Boolean Compare(char* o_name, int o_num);
Boolean Compare(Object* obj);
Boolean Set_owner(void* o);
void Cprint(FILE* fp_out, char* head);
void Cprint(FILE* fp_out) ;
void Cprint(char* head ) ;
void Oprint(FILE* fp_out, char* head);
void Oprint(FILE* fp_out) ;
void Oprint(char* head ) ;
void Absname( char* absname );
Boolean Init(char* o_name, int o_num);
protected:
char* class_name;
char* object_name;
int object_number;
void* owner;

Back to the top of Object


Ancestors

Class does not inherit from any other class.

Back to the top of Object


Descendants

Back to the top of Object


Generated from source by the Cocoon utilities on Sun Sep 3 22:52:03 2000 .

Report problems to jkotula@stratasys.com