PLearn 0.1
Public Member Functions | Protected Attributes | Friends
PLearn::pl_streammarker Class Reference

#include <pl_streambuf.h>

Collaboration diagram for PLearn::pl_streammarker:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 pl_streammarker (pl_streambuf *_buf)
 ctor. to mark a pl_streambuf
 pl_streammarker (streambuf *_buf)
 ctor. to mark an STL streambuf (...only if it's really a pl_streambuf)
virtual ~pl_streammarker ()

Protected Attributes

pl_streambufbuf
 marked buffer
pl_streammarkernext_marker
 next marker for the marked buffer (linked list)
int pos
 marked position

Friends

class pl_streambuf

Detailed Description

pl_streammarker: used to mark a position on a pl_streambuf

Definition at line 118 of file pl_streambuf.h.


Constructor & Destructor Documentation

pl_streammarker::pl_streammarker ( pl_streambuf _buf)

ctor. to mark a pl_streambuf

Definition at line 189 of file pl_streambuf.cc.

References buf, and PLearn::pl_streambuf::first_marker.

pl_streammarker::pl_streammarker ( streambuf _buf)

ctor. to mark an STL streambuf (...only if it's really a pl_streambuf)

Definition at line 194 of file pl_streambuf.cc.

References buf, PLearn::pl_streambuf::curpos(), PLearn::pl_streambuf::first_marker, next_marker, PLERROR, and pos.

    :buf(dynamic_cast<pl_streambuf*>(_buf))
{
    if(buf == 0)
        PLERROR("Cannot put a pl_streammarker on a streambuf that is not a pl_streambuf...");
    next_marker= buf->first_marker;
    pos= buf->curpos();
  
    buf->first_marker= this; 
}

Here is the call graph for this function:

pl_streammarker::~pl_streammarker ( ) [virtual]

Definition at line 206 of file pl_streambuf.cc.

References buf, PLearn::pl_streambuf::first_marker, and next_marker.

{
    pl_streammarker* prev= 0; 
    for(pl_streammarker* it= buf->first_marker; it != 0; prev= it, it!=0?it= it->next_marker:it= 0)
        if(it == this)
        {
            if(prev == 0)
                buf->first_marker= it->next_marker;
            else
                prev->next_marker= it->next_marker;
            it= 0;
        }
}

Friends And Related Function Documentation

friend class pl_streambuf [friend]

Definition at line 120 of file pl_streambuf.h.


Member Data Documentation

marked buffer

Definition at line 124 of file pl_streambuf.h.

Referenced by pl_streammarker(), and ~pl_streammarker().

next marker for the marked buffer (linked list)

Definition at line 125 of file pl_streambuf.h.

Referenced by pl_streammarker(), and ~pl_streammarker().

marked position

Definition at line 126 of file pl_streambuf.h.

Referenced by pl_streammarker(), and PLearn::pl_streambuf::seekmark().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines