ContRap-Core
Public Types | Public Member Functions

crp::Object Class Reference

Class Object is the interface for all ContRap objects. More...

#include <object.h>

Inheritance diagram for crp::Object:
crp::AtomicFunction crp::Command crp::Function crp::Identifier crp::List crp::ListRef crp::Scope crp::Template

Public Types

enum  Type {
  DATA, STRING, NUMBER, IDENTIFIER,
  FUNCTION, ATOMIC_FUNCTION, OBJECT, LIST,
  COMMAND, SCOPE, CLASS, INSTANCE,
  USER
}
 

Enumerates basic object types.

More...

Public Member Functions

 Object ()
 Object constructor.
virtual ~Object ()
 Virtual destructor.
virtual std::string get_type_name () const
 Returns the type of the object.
virtual Object::Type get_type () const
 Returns the enumerated type of the object.
virtual std::string to_string () const
 Converts the object to a non-formatted string.
virtual bool is_comparable (const Object &object)
 Returns true if the current object can be compared with the given object.
virtual bool identical_to (const Object &object) const
 Identity operator for objects.
virtual bool operator== (const Object &object) const
 Equality operator for objects.

Detailed Description

Class Object is the interface for all ContRap objects.


Member Enumeration Documentation

Enumerates basic object types.

Enumerator:
DATA 
STRING 
NUMBER 
IDENTIFIER 
FUNCTION 
ATOMIC_FUNCTION 
OBJECT 
LIST 
COMMAND 
SCOPE 
CLASS 
INSTANCE 
USER 

Constructor & Destructor Documentation

crp::Object::Object ( )

Object constructor.

virtual crp::Object::~Object ( ) [virtual]

Virtual destructor.


Member Function Documentation

virtual Object::Type crp::Object::get_type ( ) const [inline, virtual]

Returns the enumerated type of the object.

Returns:
Type of the object

Reimplemented in crp::Class, crp::Command, crp::AtomicFunction, crp::Identifier, crp::Instance, crp::List, and crp::Scope.

virtual std::string crp::Object::get_type_name ( ) const [inline, virtual]

Returns the type of the object.

Returns:
Type of the object

Reimplemented in crp::Identifier, crp::List, and crp::Template.

virtual bool crp::Object::identical_to ( const Object object) const [inline, virtual]

Identity operator for objects.

The trivial implementation is the identity check. This function always returns a boolean result independent of comparability.

Parameters:
objectObject to compare with
Returns:
True if the objects are equal
virtual bool crp::Object::is_comparable ( const Object object) [inline, virtual]

Returns true if the current object can be compared with the given object.

Parameters:
objectObject to compare
Returns:
True if the objects can be compared
virtual bool crp::Object::operator== ( const Object object) const [inline, virtual]

Equality operator for objects.

The trivial implementation is the identity check. This function always returns a boolean result independent of comparability.

Parameters:
objectObject to compare with
Returns:
True if the objects are equal
virtual std::string crp::Object::to_string ( ) const [inline, virtual]

Converts the object to a non-formatted string.

This method is thought to be used for debugging purposes only.

Returns:
String representation of the object

Reimplemented in crp::Block, crp::Call, crp::Class, crp::Command, crp::Assignment, crp::Declaration, crp::Selector, crp::Load, crp::Statement, crp::Conditional, crp::AtomicFunction, crp::Function, crp::Identifier, crp::Instance, crp::List, and crp::Scope.


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