Changeset 29:54c2d451f8a0 in xplcommon for src


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

Implemented a blocking stream and a corresponding trst program

Location:
src/xplcommon
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • src/xplcommon/Buffer.h

    r5 r29  
    9696
    9797    /**
     98     * Get whether the buffer is empty or not.
     99     */
     100    bool isEmpty() const;
     101
     102    /**
    98103     * Get the available capacity in the buffer.
    99104     */
     
    172177{
    173178    return length;
     179}
     180
     181//------------------------------------------------------------------------------
     182
     183inline bool Buffer::isEmpty() const
     184{
     185    return length==0;
    174186}
    175187
  • src/xplcommon/BufferedStream.h

    r21 r29  
    9393//------------------------------------------------------------------------------
    9494
    95 // #include "win32/BufferedStream.h"
     95#include "win32/BufferedStream.h"
    9696
    97 // namespace xplcommon { typedef win32::BufferedStream BufferedStream; }
     97namespace xplcommon { typedef win32::BufferedStream BufferedStream; }
    9898
    9999//------------------------------------------------------------------------------
  • src/xplcommon/Makefile.am

    r27 r29  
    1010
    1111libxplcommon_la_SOURCES= \
     12        PseudoRandom.cc         \
    1213        Buffer.cc               \
    13         PseudoRandom.cc
     14        BlockingStream.cc
    1415
    1516if TARGET_API_POSIX
     
    2526        config.h                \
    2627        types.h                 \
     28        PseudoRandom.h          \
    2729        Failable.h              \
    2830        Thread.h                \
     
    3840        LocalConnector.h        \
    3941        LocalClientSocket.h     \
    40         PseudoRandom.h
     42        BlockingStream.h
  • src/xplcommon/posix/ReadingBuffer.cc

    r21 r29  
    6363        stream.events &= ~POLLIN;
    6464        size_t added = addLength(result);
    65         assert(added==result);
    66         assert(getLength()==result);
     65        assert(static_cast<ssize_t>(added)==result);
     66        assert(static_cast<ssize_t>(getLength())==result);
    6767    }
    6868    return result>=0;
  • src/xplcommon/posix/Waiter.cc

    r14 r29  
    4949    {
    5050        Waitable* waitable = i->second;
    51         if (waitable->ready()) return true;
     51        if (waitable->ready()) {
     52            return true;
     53        }
    5254    }
    5355    return false;
Note: See TracChangeset for help on using the changeset viewer.