NEST  2.6.0,not_revisioned_source_dir@0
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
FunctionDatum Class Reference

#include <functiondatum.h>

Inheritance diagram for FunctionDatum:
TypedDatum<&SLIInterpreter::Functiontype > Datum

Public Member Functions

 FunctionDatum (FunctionDatum const &fd)
 
 FunctionDatum (Name const &n, SLIFunction const *f)
 
void print (std::ostream &o) const
 
void pprint (std::ostream &o) const
 
void info (std::ostream &out) const
 
bool equals (Datum const *dat) const
 
const Namegetname (void) const
 
void backtrace (SLIInterpreter *, int) const
 
- Public Member Functions inherited from TypedDatum<&SLIInterpreter::Functiontype >
 TypedDatum (void)
 
- Public Member Functions inherited from Datum
virtual ~Datum ()
 
void addReference () const
 
void removeReference ()
 
size_t numReferences () const
 
bool is_executable () const
 
void set_executable ()
 
void unset_executable ()
 
virtual void list (std::ostream &o, std::string prefix, int l) const
 
virtual void input_form (std::ostream &o) const
 
const Namegettypename (void) const
 
bool isoftype (SLIType const &t) const
 
void execute (SLIInterpreter *i)
 

Static Public Member Functions

static void * operator new (size_t size)
 
static void operator delete (void *p, size_t size)
 

Private Member Functions

Datumclone (void) const
 Virtual copy constructor. More...
 
Datumget_ptr ()
 Returns a reference counted pointer to the datum, or a new pointer, if the type does not support reference counting. More...
 
SLIFunction const & operator= (SLIFunction const &f)
 

Private Attributes

Name name
 

Static Private Attributes

static sli::pool memory
 

Additional Inherited Members

- Protected Member Functions inherited from TypedDatum<&SLIInterpreter::Functiontype >
 TypedDatum (const TypedDatum< slt > &d)
 
const TypedDatum< slt > & operator= (const TypedDatum< slt > &)
 
- Protected Member Functions inherited from Datum
 Datum ()
 
 Datum (const SLIType *t)
 
 Datum (const Datum &d)
 
- Protected Attributes inherited from Datum
const SLITypetype
 Pointer to type object. More...
 
const SLIFunctionaction
 Shortcut to the SLIType default action. More...
 
unsigned int reference_count_
 
bool executable_
 

Constructor & Destructor Documentation

FunctionDatum::FunctionDatum ( FunctionDatum const &  fd)
inline

References Datum::set_executable().

Referenced by clone().

FunctionDatum::FunctionDatum ( Name const &  n,
SLIFunction const *  f 
)
inline

Here, we shortcut the default action of the type object and directly place the function pointer in the datum's action field. Thus, we avoid an extra virtual function call.

References Datum::action, and Datum::set_executable().

Member Function Documentation

void FunctionDatum::backtrace ( SLIInterpreter i,
int  p 
) const
Datum* FunctionDatum::clone ( void  ) const
inlineprivatevirtual

Virtual copy constructor.

Use this function to lazily copy a datum.

Implements Datum.

References FunctionDatum().

bool FunctionDatum::equals ( Datum const *  dat) const
inlinevirtual

Reimplemented from Datum.

References Datum::action.

Datum* FunctionDatum::get_ptr ( )
inlineprivatevirtual

Returns a reference counted pointer to the datum, or a new pointer, if the type does not support reference counting.

The prefix const indicates that the pointer should be trated as const because changes affect all other references as well.

Reimplemented from Datum.

References Datum::addReference().

const Name& FunctionDatum::getname ( void  ) const
inline

References name.

Referenced by SLIInterpreter::getcurrentname().

void FunctionDatum::info ( std::ostream &  out) const
inlinevirtual

Reimplemented from Datum.

References name.

static void FunctionDatum::operator delete ( void *  p,
size_t  size 
)
inlinestatic
static void* FunctionDatum::operator new ( size_t  size)
inlinestatic

References sli::pool::alloc(), and memory.

SLIFunction const& FunctionDatum::operator= ( SLIFunction const &  f)
inlineprivate

References Datum::action, and name.

void FunctionDatum::pprint ( std::ostream &  o) const
inlinevirtual

Implements Datum.

References print().

Referenced by FunctiontypeFunction::execute().

void FunctionDatum::print ( std::ostream &  o) const
inlinevirtual

Implements Datum.

References name.

Referenced by pprint().

Member Data Documentation

sli::pool FunctionDatum::memory
staticprivate

Referenced by operator delete(), and operator new().

Name FunctionDatum::name
private

Referenced by getname(), info(), operator=(), and print().


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