Ignore:
Timestamp:
01/02/13 06:50:19 (11 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
default
Phase:
public
Message:

Eliminated the double storage of the Overlappable instances in the children of Completer

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/xplcommon/win32/StreamBuffer.h

    r21 r23  
    5252protected:
    5353    /**
    54      * The buffered stream this stream buffer belongs to.
    55      */
    56     BufferedStream& stream;
    57 
    58 protected:
    59     /**
    6054     * Construct the stream buffer with the given capacity and for the
    6155     * given stream.
    6256     */
    6357    StreamBuffer(size_t capacity, BufferedStream* stream);
     58
     59    /**
     60     * Get the stream.
     61     *
     62     * This just casts the overlappable of the Completer part knowing
     63     * that it must be a BufferedStream
     64     */
     65    BufferedStream& getStream() const;
    6466
    6567private:
     
    8385inline StreamBuffer::StreamBuffer(size_t capacity, BufferedStream* stream) :
    8486    Buffer(capacity),
    85     Completer(stream),
    86     stream(*stream)
     87    Completer(stream)
    8788{
     89}
     90
     91//------------------------------------------------------------------------------
     92
     93inline BufferedStream& StreamBuffer::getStream() const
     94{
     95    return static_cast<BufferedStream&>(overlappable);
    8896}
    8997
     
    92100inline const ::xplcommon::Failable& StreamBuffer::getFailable() const
    93101{
    94     return stream;
     102    return overlappable;
    95103}
    96104
     
    99107inline ::xplcommon::Failable& StreamBuffer::getFailable()
    100108{
    101     return stream;
     109    return overlappable;
    102110}
    103111
Note: See TracChangeset for help on using the changeset viewer.