ContRap-Core
|
Class Object is the interface for all ContRap objects. More...
#include <object.h>
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. |
enum crp::Object::Type |
crp::Object::Object | ( | ) |
Object constructor.
virtual crp::Object::~Object | ( | ) | [virtual] |
Virtual destructor.
virtual Object::Type crp::Object::get_type | ( | ) | const [inline, virtual] |
Returns the enumerated 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.
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.
object | Object to compare with |
virtual bool crp::Object::is_comparable | ( | const Object & | object | ) | [inline, virtual] |
Returns true if the current object can be compared with the given object.
object | Object to compare |
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.
object | Object to compare with |
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.
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.