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

SDoubleListRange Class Reference

#include <sdbllist.hpp>

Collaboration diagram for SDoubleListRange:

Collaboration graph
[legend]
List of all members.

Detailed Description

A part of a doubly-linked list.

Definition at line 219 of file sdbllist.hpp.

Public Member Functions

 SDoubleListRange ()
 Default constructor.
 SDoubleListRange (const SDoubleListRef &a_master)
 Range to match the whole list.
 SDoubleListRange (const SDoubleListRef &a_master, const SBacklinkRef &a_first, const SBacklinkRef &a_follow)
 Arbitrary range.
 SDoubleListRange (const SDoubleListRange &o)
 Copy constructor.
void operator= (const SDoubleListRange &a)
 Assignment.
bool IsEmpty () const
bool Exhausted () const
SDoubleListRef Copy () const
 Make a copy of the range.
LeftEndMover LeftEnd ()
 Get the left end of the range.
RightEndMover RightEnd ()
 Get the right end of the range.
const SDoubleListRefGetMaster () const
 Get the object we're operating on.
SBacklinkRef GetFirst () const
 Get the first item of the range.
const SBacklinkRefGetFollow () const
 Get the item which immediately follows the range.
SBacklinkRef GetLast () const
 Get the last item of the range.
void SetFirst (const SBacklinkRef &r)
 Move the left end to the given position.
void SetFollow (const SBacklinkRef &r)
 Move the right end to the given position.
SDoubleListRange WhatsBefore () const
 Get the part of the list before the range.
SDoubleListRange WhatsAfter () const
 Get the part of the list after the range.

Friends

class LeftEndMover
class RightEndMover

Classes

class  LeftEndMover
 Slave class which represents the left end of the range. More...
class  RightEndMover
 Slave class which represents the right end of the range. More...


Constructor & Destructor Documentation

SDoubleListRange::SDoubleListRange  ) 
 

Default constructor.

Warning:
No methods will work until the object is assigned to something useful! Using operator= is mandatory if the object was created with the default constructor.

Definition at line 228 of file sdbllist.hpp.

Referenced by WhatsAfter(), and WhatsBefore().

SDoubleListRange::SDoubleListRange const SDoubleListRef a_master  ) 
 

Range to match the whole list.

Definition at line 231 of file sdbllist.hpp.

References PTheEmptyList.

SDoubleListRange::SDoubleListRange const SDoubleListRef a_master,
const SBacklinkRef a_first,
const SBacklinkRef a_follow
 

Arbitrary range.

Parameters:
a_master is the doubly linked list object
a_first is the first element in the range
a_follow is the element which FOLLOWS next to the last one in the range. Thus, if a_follow points to the same position as a_first, then the range is assumed empty. The empty list means that the last item in the range is the last item in the list.

Definition at line 245 of file sdbllist.hpp.

SDoubleListRange::SDoubleListRange const SDoubleListRange o  ) 
 

Copy constructor.

Definition at line 252 of file sdbllist.hpp.


Member Function Documentation

void SDoubleListRange::operator= const SDoubleListRange a  ) 
 

Assignment.

Definition at line 257 of file sdbllist.hpp.

bool SDoubleListRange::IsEmpty  )  const
 

Is the range empty, that is, do its ends point to the same position

Definition at line 263 of file sdbllist.hpp.

References SBacklinkRef::GetPtr().

Referenced by GetFirst(), GetLast(), SDoubleListRange::RightEndMover::operator SBacklinkRef(), SDoubleListRange::LeftEndMover::operator SBacklinkRef(), SDoubleListRange::LeftEndMover::operator++(), and SDoubleListRange::RightEndMover::operator--().

bool SDoubleListRange::Exhausted  )  const
 

Is the range 'exhausted', that is, it starts nowhere?

Definition at line 266 of file sdbllist.hpp.

References SReference::IsEmptyList().

SDoubleListRef SDoubleListRange::Copy  )  const
 

Make a copy of the range.

The items are not copied, but the list cells are copied so that no SExpressionBacklink's are shared

Definition at line 166 of file sdbllist.cpp.

References SReference::Car(), SBacklinkRef::GetPtr(), and SReference::IsEmptyList().

LeftEndMover SDoubleListRange::LeftEnd  ) 
 

Get the left end of the range.

Definition at line 311 of file sdbllist.hpp.

References LeftEndMover.

Referenced by SDoubleListRange::RightEndMover::operator--().

RightEndMover SDoubleListRange::RightEnd  ) 
 

Get the right end of the range.

Definition at line 313 of file sdbllist.hpp.

References RightEndMover.

const SDoubleListRef& SDoubleListRange::GetMaster  )  const
 

Get the object we're operating on.

Definition at line 316 of file sdbllist.hpp.

SBacklinkRef SDoubleListRange::GetFirst  )  const
 

Get the first item of the range.

Definition at line 280 of file sdbllist.cpp.

References IsEmpty(), and PTheEmptyList.

const SBacklinkRef & SDoubleListRange::GetFollow  )  const
 

Get the item which immediately follows the range.

Definition at line 286 of file sdbllist.cpp.

SBacklinkRef SDoubleListRange::GetLast  )  const
 

Get the last item of the range.

Definition at line 291 of file sdbllist.cpp.

References IsEmpty(), SReference::IsEmptyList(), and PTheEmptyList.

void SDoubleListRange::SetFirst const SBacklinkRef r  ) 
 

Move the left end to the given position.

Warning:
No integrity checking is performed, be careful

Definition at line 327 of file sdbllist.hpp.

void SDoubleListRange::SetFollow const SBacklinkRef r  ) 
 

Move the right end to the given position.

Warning:
No integrity checking is performed, be careful

Definition at line 330 of file sdbllist.hpp.

SDoubleListRange SDoubleListRange::WhatsBefore  )  const
 

Get the part of the list before the range.

Definition at line 333 of file sdbllist.hpp.

References SDoubleListRange().

SDoubleListRange SDoubleListRange::WhatsAfter  )  const
 

Get the part of the list after the range.

Definition at line 336 of file sdbllist.hpp.

References PTheEmptyList, and SDoubleListRange().


Friends And Related Function Documentation

friend class LeftEndMover [friend]
 

Definition at line 290 of file sdbllist.hpp.

Referenced by LeftEnd().

friend class RightEndMover [friend]
 

Definition at line 308 of file sdbllist.hpp.

Referenced by RightEnd().


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