Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members

SReference Class Reference

#include <sexpress.hpp>

Inheritance diagram for SReference:

Inheritance graph
[legend]
Collaboration diagram for SReference:

Collaboration graph
[legend]
List of all members.

Detailed Description

'Smart pointer' to an S-expression

The class acts just like a smart pointer to an object of SExpression class. SReference has no virtual table so it is guaranteed that sizeof(SReference) == sizeof(SExpression*). This means it's no problem to pass SReferences by value. SReference is intended to be the primary API to the invented S-expression representation.

Definition at line 467 of file sexpress.hpp.

Public Member Functions

 SReference ()
 Default constructor.
 SReference (const SExpression *tp)
 Construct from a pointer.
 SReference (const SReference &other)
 The copy constructor.
 ~SReference ()
 SReference (const class SListConstructor &)
 Creates empty list repesentation.
 SReference (const SReference &car, const SReference &cdr)
 Creates a dotted pair.
SReferenceoperator= (const SReference &other)
void operator= (SExpression *newterm)
 Assignment.
SExpressionGetPtr () const
 Get a plain pointer.
SReferenceAddAnotherItemToList (const SReference &right)
 Add item to list.
SReferenceChangeListEnd (const SReference &new_last)
 Make/change dotted list.
SReference MakeCons (const SReference &right) const
 Make a cons.
SReferenceoperator, (const SReference &r)
 List composing operation.
SReferenceoperator|| (const SReference &t)
 dotted list composing operation
SReference operator^ (const SReference &t) const
 CONS operation.
bool operator== (const SReference &other) const
 Equality is just pointer comparision.
bool operator!= (const SReference &other) const
 Non-equality is just pointer comparision.
bool operator== (const SExpression *other) const
 Equality is just pointer comparision.
bool operator!= (const SExpression *other) const
 Non-equality is just pointer comparision.
bool IsEql (const SReference &other) const
bool IsEqual (const SReference &other) const
SReferenceCar () const
SReferenceCdr () const
SReferenceCCar () const
SReferenceCCdr () const
intelib_float_t GetFloat () const
intelib_integer_t GetInt () const
const char * GetString () const
char GetSingleChar () const
template<class Tp>
Tp * DynamicCastGetPtr () const
template<class Tp>
Tp * SimpleCastGetPtr () const
SReference Clone () const
SReference CopyList () const
SReference CopyTree () const
bool IsEmptyList () const
SExpressionoperator-> () const
 Field/method selection.
SExpressionoperator * () const
 Dereference.
 SReference (char c)
 SReference (signed char c)
 SReference (unsigned char c)
 SReference (signed short i)
 SReference (unsigned short i)
 SReference (signed int i)
 SReference (unsigned int i)
 SReference (signed long i)
 SReference (unsigned long i)
 SReference (signed long long i)
 SReference (unsigned long long i)
 SReference (float f)
 SReference (double f)
 SReference (long double f)
 SReference (const char *s)
 SReference (const unsigned char *s)


Constructor & Destructor Documentation

SReference::SReference  ) 
 

Default constructor.

Creates NULL (unbound) reference

Definition at line 471 of file sexpress.hpp.

Referenced by SQueue::operator,(), SString::operator=(), SQueue::operator|(), SchReference::operator~(), LReference::operator~(), and SExpressionDoubleList::Iterator::Remove().

SReference::SReference const SExpression tp  ) 
 

Construct from a pointer.

Definition at line 474 of file sexpress.hpp.

SReference::SReference const SReference other  ) 
 

The copy constructor.

Definition at line 477 of file sexpress.hpp.

SReference::~SReference  ) 
 

Definition at line 480 of file sexpress.hpp.

SReference::SReference char  c  ) 
 

These constructors allow to cast any standard scalar type to the appropriate S-expression

Definition at line 385 of file sexpress.cpp.

SReference::SReference signed char  c  ) 
 

These constructors allow to cast any standard scalar type to the appropriate S-expression

Definition at line 390 of file sexpress.cpp.

SReference::SReference unsigned char  c  ) 
 

These constructors allow to cast any standard scalar type to the appropriate S-expression

Definition at line 395 of file sexpress.cpp.

SReference::SReference signed short  i  ) 
 

These constructors allow to cast any standard scalar type to the appropriate S-expression

Definition at line 400 of file sexpress.cpp.

SReference::SReference unsigned short  i  ) 
 

These constructors allow to cast any standard scalar type to the appropriate S-expression

Definition at line 404 of file sexpress.cpp.

SReference::SReference signed int  i  ) 
 

These constructors allow to cast any standard scalar type to the appropriate S-expression

Definition at line 408 of file sexpress.cpp.

SReference::SReference unsigned int  i  ) 
 

These constructors allow to cast any standard scalar type to the appropriate S-expression

Definition at line 412 of file sexpress.cpp.

SReference::SReference signed long  i  ) 
 

These constructors allow to cast any standard scalar type to the appropriate S-expression

Definition at line 416 of file sexpress.cpp.

SReference::SReference unsigned long  i  ) 
 

These constructors allow to cast any standard scalar type to the appropriate S-expression

Definition at line 420 of file sexpress.cpp.

SReference::SReference signed long long  i  ) 
 

These constructors allow to cast any standard scalar type to the appropriate S-expression

Definition at line 424 of file sexpress.cpp.

SReference::SReference unsigned long long  i  ) 
 

These constructors allow to cast any standard scalar type to the appropriate S-expression

Definition at line 428 of file sexpress.cpp.

SReference::SReference float  f  ) 
 

These constructors allow to cast any standard scalar type to the appropriate S-expression

Definition at line 432 of file sexpress.cpp.

SReference::SReference double  f  ) 
 

These constructors allow to cast any standard scalar type to the appropriate S-expression

Definition at line 436 of file sexpress.cpp.

SReference::SReference long double  f  ) 
 

These constructors allow to cast any standard scalar type to the appropriate S-expression

Definition at line 440 of file sexpress.cpp.

SReference::SReference const char *  s  ) 
 

These constructors allow to cast any standard scalar type to the appropriate S-expression

SReference::SReference const unsigned char *  s  ) 
 

These constructors allow to cast any standard scalar type to the appropriate S-expression

SReference::SReference const class SListConstructor  ) 
 

Creates empty list repesentation.

SReference::SReference const SReference car,
const SReference cdr
 

Creates a dotted pair.


Member Function Documentation

SReference& SReference::operator= const SReference other  ) 
 

Reimplemented in SBacklinkRef.

Definition at line 508 of file sexpress.hpp.

References GenericReference< Tp >::operator=().

Referenced by SQueue::Append(), SQueue::InsertFirst(), SVector::operator=(), SString::operator=(), SBacklinkRef::operator=(), GenericSReference< LExpressionContext, IntelibX_lisp_not_a_context >::operator=(), SExpressionDoubleList::Iterator::Remove(), SQueue::RemoveFirst(), and SQueue::SQueue().

void SReference::operator= SExpression newterm  ) 
 

Assignment.

Reimplemented from GenericReference< SExpression >.

Definition at line 510 of file sexpress.hpp.

References GenericReference< Tp >::operator=().

SExpression* SReference::GetPtr  )  const
 

Get a plain pointer.

Reimplemented from GenericReference< SExpression >.

Reimplemented in GenericSReference< Tp, X_wrongtype >, SBacklinkRef, SQueue, GenericSReference< SExpressionStream, IntelibX_not_a_stream >, GenericSReference< SchExpressionContext, IntelibX_scheme_not_a_context >, GenericSReference< SExpressionWrapper< Data >, IntelibX_wrong_expression_type >, GenericSReference< LExpressionSymbol, IntelibX_lisp_not_a_symbol >, GenericSReference< SExpressionDoubleList, IntelibX_not_a_doublelist >, GenericSReference< SExpressionString, IntelibX_not_a_string >, GenericSReference< SExpressionHashPackage, IntelibX_not_a_package >, GenericSReference< SExpressionVector, IntelibX_not_a_vector >, GenericSReference< SExpressionHashTable, IntelibX_not_a_hash_table >, GenericSReference< SchExpressionSymbol, IntelibX_scheme_not_a_symbol >, and GenericSReference< LExpressionContext, IntelibX_lisp_not_a_context >.

Definition at line 513 of file sexpress.hpp.

References GenericReference< Tp >::GetPtr().

Referenced by IntelibGenericReader::AddSequenceOpener(), IntelibX::AddStack(), LispLambdaBody::DoAnalyseLambdaList(), DynamicCastGetPtr(), SExpressionHashTable::FindItem(), SExpressionHashPackage::FindSymbol(), SExpressionHashTable::GetItemPosition(), SExpressionHashTable::Iterator::GetNext(), SQueue::GetPtr(), SBacklinkRef::GetPtr(), GenericSReference< LExpressionContext, IntelibX_lisp_not_a_context >::GetPtr(), SExpressionHashPackage::Intern(), SchReference::IsEql(), LReference::IsEql(), SchReference::IsTrue(), LReference::IsTrue(), operator!=(), SBacklinkRef::operator,(), operator==(), SExpressionHashTable::RemoveItem(), RetrieveFunctionObject(), SExpressionHashTable::SafeAddItem(), SimpleCastGetPtr(), stack_representation(), IntelibContinuation::Step(), SExpressionHashTable::TextRepresentation(), SchReference::TextRepresentation(), LReference::TextRepresentation(), and SExpressionBacklink::~SExpressionBacklink().

SReference& SReference::AddAnotherItemToList const SReference right  ) 
 

Add item to list.

For a list, adds another dotted pair to its end. For non-lists, the result is undefined.

Referenced by operator,().

SReference& SReference::ChangeListEnd const SReference new_last  ) 
 

Make/change dotted list.

  • For a proper (non-dotted) list, replaces its terminating () with the given argument, therefore producing a dotted list.
    • for a dotted list, changes it's terminating value (the value which is after the dot)
    • for other types, the result is undefined

Referenced by operator||().

SReference SReference::MakeCons const SReference right  )  const
 

Make a cons.

Produces a cons (dotted pair) using *this as the CAR and the given argument as the CDR

Referenced by operator^().

SReference& SReference::operator, const SReference r  ) 
 

List composing operation.

Operator "," is used to construct lists naturally, like this: (L| 1, 2, 3)

See also:
LListConstructor class

Reimplemented in SBacklinkRef, SDoubleListRef, LReference, and SchReference.

Definition at line 541 of file sexpress.hpp.

References AddAnotherItemToList().

Referenced by SchReference::operator,(), and LReference::operator,().

SReference& SReference::operator|| const SReference t  ) 
 

dotted list composing operation

Operator "||" is used to construct dotted lists, like this: ((L| 1, 2, 3) || 4) // (1 2 3 . 4)

See also:
LListConstructor class

Reimplemented in LReference, and SchReference.

Definition at line 548 of file sexpress.hpp.

References ChangeListEnd().

Referenced by SchReference::operator||(), and LReference::operator||().

SReference SReference::operator^ const SReference t  )  const
 

CONS operation.

Operator "^" is used to produce conses

Definition at line 552 of file sexpress.hpp.

References MakeCons().

bool SReference::operator== const SReference other  )  const
 

Equality is just pointer comparision.

Definition at line 556 of file sexpress.hpp.

References GetPtr().

bool SReference::operator!= const SReference other  )  const
 

Non-equality is just pointer comparision.

Definition at line 559 of file sexpress.hpp.

References GetPtr().

bool SReference::operator== const SExpression other  )  const
 

Equality is just pointer comparision.

Definition at line 562 of file sexpress.hpp.

References GetPtr().

bool SReference::operator!= const SExpression other  )  const
 

Non-equality is just pointer comparision.

Definition at line 565 of file sexpress.hpp.

References GetPtr().

bool SReference::IsEql const SReference other  )  const
 

Reimplemented in LReference, and SchReference.

Referenced by SExprsAreEql().

bool SReference::IsEqual const SReference other  )  const
 

Reimplemented in LReference, and SchReference.

Referenced by SExprsAreEqual().

SReference& SReference::Car  )  const
 

Referenced by LExpressionMacro::Call(), SDoubleListRange::Copy(), IntelibGenericReader::Get(), RetrieveFunctionObject(), and stack_representation().

SReference& SReference::Cdr  )  const
 

Referenced by LExpressionMacro::Call(), SBacklinkRef::Remove(), SQueue::RemoveFirst(), RetrieveFunctionObject(), and stack_representation().

SReference& SReference::CCar  )  const
 

SReference& SReference::CCdr  )  const
 

intelib_float_t SReference::GetFloat  )  const
 

Referenced by SExpressionIndirectTemplate< Tt >::Setf().

intelib_integer_t SReference::GetInt  )  const
 

Referenced by SExpressionIndirectTemplate< Tt >::Setf().

const char* SReference::GetString  )  const
 

Referenced by SExpressionIndirectTemplate< Tt >::Setf().

char SReference::GetSingleChar  )  const
 

template<class Tp>
Tp * SReference::DynamicCastGetPtr  )  const
 

Definition at line 687 of file sexpress.hpp.

References GetPtr(), IntelibTypeId::IsSubtypeOf(), and SExpression::TermType().

Referenced by LispLambdaBody::DoAnalyseLambdaList(), SExpressionBacklink::InsertAfter(), SBacklinkRef::operator,(), pretty_print(), IntelibGenericReader::Read(), SBacklinkRef::Remove(), SExpressionBacklink::RemoveNext(), RetrieveFunctionObject(), SQueue::SQueue(), and SExpressionBacklink::~SExpressionBacklink().

template<class Tp>
Tp * SReference::SimpleCastGetPtr  )  const
 

Definition at line 695 of file sexpress.hpp.

References GetPtr(), and SExpression::TermType().

SReference SReference::Clone  )  const
 

Referenced by SExpressionVector::Clone(), and SExpressionHashTable::Clone().

SReference SReference::CopyList  )  const
 

SReference SReference::CopyTree  )  const
 

bool SReference::IsEmptyList  )  const
 

Referenced by SBacklinkRef::Begin(), LExpressionMacro::Call(), SExpressionBacklink::ConnectBack(), SDoubleListRange::Copy(), SBacklinkRef::End(), SExpressionDoubleList::Exclude(), SDoubleListRange::Exhausted(), SExpressionDoubleList::Iterator::Exhausted(), SDoubleListRange::GetLast(), SBacklinkRef::GetPtr(), SBacklinkRef::InsertAfter(), SExpressionDoubleList::InsertListAfter(), SExpressionDoubleList::Iterator::IsBegin(), SQueue::IsEmpty(), SExpressionDoubleList::Iterator::IsEnd(), SBacklinkRef::operator++(), SBacklinkRef::operator,(), SDoubleListRange::RightEndMover::operator--(), SDoubleListRange::LeftEndMover::operator--(), SBacklinkRef::operator--(), pretty_print(), SExpressionDoubleList::Iterator::Remove(), SBacklinkRef::Remove(), SExpressionBacklink::RemoveNext(), SQueue::SQueue(), stack_representation(), SchReference::TextRepresentation(), LReference::TextRepresentation(), and SExpressionBacklink::~SExpressionBacklink().

SExpression * GenericReference< SExpression >::operator->  )  const [inherited]
 

Field/method selection.

Reimplemented in GenericSReference< Tp, X_wrongtype >, SBacklinkRef, GenericSReference< SExpressionStream, IntelibX_not_a_stream >, GenericSReference< SchExpressionContext, IntelibX_scheme_not_a_context >, GenericSReference< SExpressionWrapper< Data >, IntelibX_wrong_expression_type >, GenericSReference< LExpressionSymbol, IntelibX_lisp_not_a_symbol >, GenericSReference< SExpressionDoubleList, IntelibX_not_a_doublelist >, GenericSReference< SExpressionString, IntelibX_not_a_string >, GenericSReference< SExpressionHashPackage, IntelibX_not_a_package >, GenericSReference< SExpressionVector, IntelibX_not_a_vector >, GenericSReference< SExpressionHashTable, IntelibX_not_a_hash_table >, GenericSReference< SchExpressionSymbol, IntelibX_scheme_not_a_symbol >, and GenericSReference< LExpressionContext, IntelibX_lisp_not_a_context >.

Definition at line 175 of file refcount.hpp.

References GenericReference< Tp >::GetPtr().

SExpression & GenericReference< SExpression >::operator *  )  const [inherited]
 

Dereference.

Reimplemented in GenericSReference< Tp, X_wrongtype >, GenericSReference< SExpressionStream, IntelibX_not_a_stream >, GenericSReference< SchExpressionContext, IntelibX_scheme_not_a_context >, GenericSReference< SExpressionWrapper< Data >, IntelibX_wrong_expression_type >, GenericSReference< LExpressionSymbol, IntelibX_lisp_not_a_symbol >, GenericSReference< SExpressionDoubleList, IntelibX_not_a_doublelist >, GenericSReference< SExpressionString, IntelibX_not_a_string >, GenericSReference< SExpressionHashPackage, IntelibX_not_a_package >, GenericSReference< SExpressionVector, IntelibX_not_a_vector >, GenericSReference< SExpressionHashTable, IntelibX_not_a_hash_table >, GenericSReference< SchExpressionSymbol, IntelibX_scheme_not_a_symbol >, and GenericSReference< LExpressionContext, IntelibX_lisp_not_a_context >.

Definition at line 179 of file refcount.hpp.

References GenericReference< Tp >::GetPtr().


The documentation for this class was generated from the following files:
Generated on Tue Dec 18 00:42:37 2007 for InteLib by  doxygen 1.4.1