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

SQueue Class Reference

#include <squeue.hpp>

Inheritance diagram for SQueue:

Inheritance graph
[legend]
Collaboration diagram for SQueue:

Collaboration graph
[legend]
List of all members.

Detailed Description

Heterogenous queue.

This is in fact just a list for which a pointer to its last item is stored. The only gain is that the comma operation works faster for this class than for SReference. This class has to be 8 bytes long so you wouldn't pass it by value (heh, you CAN'T do it in this version because the copy constructor was intentionally made private).

Note:
There's no separate SExpression for this. If you try to make such an object a member of another S-expression then a plain list will become the member, and it will share the data structure with the container.
Warning:
Modification of the underlying list is possible, but the results will be undefined if you break the connectivity of the list and/or do something to its head and the last cons.

In this version, direct assigning and copying of queues are prohibited. Copying can be emulated, however, by constructing SReference object and then an SQueue object from it. Rationale is that the user should realize what does he REALLY do.

Definition at line 50 of file squeue.hpp.

Public Member Functions

 SQueue ()
 Just an empty queue.
 SQueue (const SReference &ref)
 Construct from existing list.
 ~SQueue ()
 Destructor.
void InsertFirst (const SReference &item)
 Insert an item before all the resting queue.
void Append (const SReference &item)
 Append another item to the queue (at the end).
bool RemoveFirst ()
 Remove the first item.
bool IsEmpty () const
 Is the queue currently empty.
template<class Tp>
SQueueoperator| (const Tp &t)
 Append another item.
template<class Tp>
SQueueoperator, (const Tp &t)
 Append another item.
SExpressionConsGetPtr () const
 Get the address of the first cons in the queue.
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 SExpression *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
 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.


Constructor & Destructor Documentation

SQueue::SQueue  ) 
 

Just an empty queue.

Definition at line 23 of file squeue.cpp.

References PTheEmptyList.

SQueue::SQueue const SReference ref  ) 
 

Construct from existing list.

This uses SReference::CopyList() to make a copy of the list. Be sure you are not copying too long data structures

Definition at line 27 of file squeue.cpp.

References SExpressionCons::Cdr(), SReference::DynamicCastGetPtr(), GetPtr(), SReference::IsEmptyList(), and SReference::operator=().

SQueue::~SQueue  ) 
 

Destructor.

Definition at line 64 of file squeue.hpp.


Member Function Documentation

void SQueue::InsertFirst const SReference item  ) 
 

Insert an item before all the resting queue.

Definition at line 43 of file squeue.cpp.

References IsEmpty(), and SReference::operator=().

void SQueue::Append const SReference item  ) 
 

Append another item to the queue (at the end).

Definition at line 52 of file squeue.cpp.

References SExpressionCons::Cdr(), IsEmpty(), SReference::operator=(), and PTheEmptyList.

Referenced by operator,(), and operator|().

bool SQueue::RemoveFirst  ) 
 

Remove the first item.

Definition at line 64 of file squeue.cpp.

References SReference::Cdr(), GetPtr(), IsEmpty(), and SReference::operator=().

Referenced by IntelibGenericReader::Drop(), and IntelibGenericReader::Get().

bool SQueue::IsEmpty  )  const
 

Is the queue currently empty.

Definition at line 73 of file squeue.hpp.

References SReference::IsEmptyList().

Referenced by Append(), InsertFirst(), IntelibGenericReader::IsEmpty(), IntelibGenericReader::IsReady(), and RemoveFirst().

template<class Tp>
SQueue& SQueue::operator| const Tp &  t  ) 
 

Append another item.

Definition at line 76 of file squeue.hpp.

References Append(), and SReference::SReference().

template<class Tp>
SQueue& SQueue::operator, const Tp &  t  ) 
 

Append another item.

Definition at line 80 of file squeue.hpp.

References Append(), and SReference::SReference().

SExpressionCons* SQueue::GetPtr  )  const
 

Get the address of the first cons in the queue.

Reimplemented from SReference.

Definition at line 84 of file squeue.hpp.

References SReference::GetPtr().

Referenced by RemoveFirst(), and SQueue().

SReference& SReference::AddAnotherItemToList const SReference right  )  [inherited]
 

Add item to list.

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

Referenced by SReference::operator,().

SReference& SReference::ChangeListEnd const SReference new_last  )  [inherited]
 

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 SReference::operator||().

SReference SReference::MakeCons const SReference right  )  const [inherited]
 

Make a cons.

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

Referenced by SReference::operator^().

SReference& SReference::operator, const SReference r  )  [inherited]
 

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 SReference::AddAnotherItemToList().

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

SReference& SReference::operator|| const SReference t  )  [inherited]
 

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 SReference::ChangeListEnd().

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

SReference SReference::operator^ const SReference t  )  const [inherited]
 

CONS operation.

Operator "^" is used to produce conses

Definition at line 552 of file sexpress.hpp.

References SReference::MakeCons().

bool SReference::operator== const SReference other  )  const [inherited]
 

Equality is just pointer comparision.

Definition at line 556 of file sexpress.hpp.

References SReference::GetPtr().

bool SReference::operator== const SExpression other  )  const [inherited]
 

Equality is just pointer comparision.

Definition at line 562 of file sexpress.hpp.

References SReference::GetPtr().

bool SReference::operator!= const SReference other  )  const [inherited]
 

Non-equality is just pointer comparision.

Definition at line 559 of file sexpress.hpp.

References SReference::GetPtr().

bool SReference::operator!= const SExpression other  )  const [inherited]
 

Non-equality is just pointer comparision.

Definition at line 565 of file sexpress.hpp.

References SReference::GetPtr().

bool SReference::IsEql const SReference other  )  const [inherited]
 

Reimplemented in LReference, and SchReference.

Referenced by SExprsAreEql().

bool SReference::IsEqual const SReference other  )  const [inherited]
 

Reimplemented in LReference, and SchReference.

Referenced by SExprsAreEqual().

SReference& SReference::Car  )  const [inherited]
 

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

SReference& SReference::Cdr  )  const [inherited]
 

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

SReference& SReference::CCar  )  const [inherited]
 

SReference& SReference::CCdr  )  const [inherited]
 

intelib_float_t SReference::GetFloat  )  const [inherited]
 

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

intelib_integer_t SReference::GetInt  )  const [inherited]
 

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

const char* SReference::GetString  )  const [inherited]
 

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

char SReference::GetSingleChar  )  const [inherited]
 

template<class Tp>
Tp * SReference::DynamicCastGetPtr  )  const [inherited]
 

Definition at line 687 of file sexpress.hpp.

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

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

template<class Tp>
Tp * SReference::SimpleCastGetPtr  )  const [inherited]
 

Definition at line 695 of file sexpress.hpp.

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

SReference SReference::Clone  )  const [inherited]
 

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

SReference SReference::CopyList  )  const [inherited]
 

SReference SReference::CopyTree  )  const [inherited]
 

bool SReference::IsEmptyList  )  const [inherited]
 

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(), 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(), 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:35 2007 for InteLib by  doxygen 1.4.1