Concrete Python  git-339c971
Classes | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions
Object Class Reference

#include <concrete/objects/object-partial.hpp>

+ Inheritance diagram for Object:
+ Collaboration diagram for Object:

List of all members.

Classes

struct  Data
struct  NoRefInit
struct  RawAccess

Public Member Functions

 Object () throw ()
 Object (const Object &other) throw ()
 ~Object () throw ()
void operator= (const Object &other) throw ()
 operator bool () const throw ()
bool operator! () const throw ()
template<typename ObjectType >
bool check () const
template<typename ObjectType >
ObjectType require () const
TypeObject type () const
const PortableObjectProtocolprotocol () const
StringObject repr () const
StringObject str () const
template<typename Visitor >
void visit (Visitor &v) const

Static Public Member Functions

static TypeObject Type ()
static Object New ()

Protected Member Functions

 Object (unsigned int address) throw ()

Static Protected Member Functions

template<typename ObjectType , typename... Args>
static ObjectType NewObject (Args...args)
template<typename ObjectType , typename... Args>
static ObjectType NewCustomSizeObject (size_t size, Args...args)

Detailed Description

Reference-counted indirect arena memory pointer. Represents the root of the Python object hierarchy.


Constructor & Destructor Documentation

Object ( ) throw ()

Generic NoneObject reference.

Object ( const Object other) throw ()

Another reference.

~Object ( ) throw ()

Drop the reference. The object is deleted if this was the last reference.

Object ( unsigned int  address) throw () [explicit, protected]

Reference to the Object at an explicit arena offset.


Member Function Documentation

bool check ( ) const
Returns:
true if this is a reference to an ObjectType instance or a derivative
Object New ( ) [static]

Create an Object instance.

Returns:
a reference

Reimplemented in DictObject, and TupleObject.

ObjectType NewCustomSizeObject ( size_t  size,
Args...  args 
) [static, protected]

Create an ObjectType instance.

Parameters:
sizeof the memory allocation for extended data types (including the Data struct size)
Returns:
a reference
Exceptions:
AllocationError
...
ObjectType NewObject ( Args...  args) [static, protected]

Create an ObjectType instance.

Returns:
a reference
Exceptions:
AllocationError
...
operator bool ( ) const throw ()
Returns:
true if this is not a NoneObject reference

Reimplemented from Pointer.

bool operator! ( ) const throw ()
Returns:
true if this is a NoneObject reference

Reimplemented from Pointer.

void operator= ( const Object other) throw ()

Replace the reference.

const PortableObjectProtocol * protocol ( ) const

Direct access to built-in method vector.

Returns:
borrowed short-term reference

Reimplemented in TypeObject.

StringObject repr ( ) const

Invoke the built-in repr method of the subtype.

ObjectType require ( ) const

Get a new typed reference.

Exceptions:
TypeErrorif this is not a reference to an ObjectType instance or a derivative
StringObject str ( ) const

Invoke the built-in str method of the subtype.

TypeObject Type ( ) [static]
TypeObject type ( ) const
Returns:
a reference to the TypeObject instance representing the subtype
void visit ( Visitor &  v) const

Visit all object references referenced by this object.

Reimplemented in InternalObject, CodeObject, BytesObject, FunctionObject, StringObject, TypeObject, LongObject, ModuleObject, NoneObject, DictObject, FloatObject, TupleObject, and BoolObject.