Changeset 3:e4ca2e057cec in xplcommon for src/xplcommon/posix/Waiter.h


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

Reorganized the code a bit

File:
1 moved

Legend:

Unmodified
Added
Removed
  • src/xplcommon/posix/Waiter.h

    r1 r3  
    2828// either expressed or implied, of the FreeBSD Project.
    2929
    30 #ifndef XPLCOMMON_POSIXWAITER_H
    31 #define XPLCOMMON_POSIXWAITER_H
    32 //------------------------------------------------------------------------------
    33 
    34 #include "config.h"
    35 
    36 #ifdef HAVE_POLL_H
    37 
     30#ifndef XPLCOMMON_POSIX_WAITER_H
     31#define XPLCOMMON_POSIX_WAITER_H
    3832//------------------------------------------------------------------------------
    3933
     
    4640//------------------------------------------------------------------------------
    4741
    48 namespace xplcommon {
     42namespace xplcommon { namespace posix {
    4943
    5044//------------------------------------------------------------------------------
    5145
    52 class POSIXWaitable;
     46class Waitable;
    5347
    5448//------------------------------------------------------------------------------
     
    5852 * for them.
    5953 */
    60 class POSIXWaiter
     54class Waiter
    6155{
    6256private:
     
    6458     * Type for the set of waitables.
    6559     */
    66     typedef std::map<int, POSIXWaitable*> waitables_t;
     60    typedef std::map<int, Waitable*> waitables_t;
    6761
    6862    /**
     
    8074     * Construct the waiter.
    8175     */
    82     POSIXWaiter();
     76    Waiter();
    8377
    8478    /**
     
    8680     * modified to point to no waiter.
    8781     */
    88     ~POSIXWaiter();
     82    ~Waiter();
    8983
    9084    /**
     
    10397     * Add a waitable.
    10498     */
    105     void add(POSIXWaitable* waitable);
     99    void add(Waitable* waitable);
    106100
    107101    /**
    108102     * Remove a waitable.
    109103     */
    110     void remove(POSIXWaitable* waitable);
     104    void remove(Waitable* waitable);
    111105
    112106private:
     
    134128    void processPollFDs(const pollfd* pollFDs, size_t size);
    135129
    136     friend class POSIXWaitable;
     130    friend class Waitable;
    137131};
    138 
    139 //------------------------------------------------------------------------------
    140 
    141 typedef POSIXWaiter Waiter;
    142132
    143133//------------------------------------------------------------------------------
     
    145135//------------------------------------------------------------------------------
    146136
    147 inline POSIXWaiter::POSIXWaiter() :
     137inline Waiter::Waiter() :
    148138    numWaitables(0)
    149139{
     
    152142//------------------------------------------------------------------------------
    153143
    154 } /* namespace xplcommon */
     144} /* namespace xplcommon::posix */ } /* namespace xplcommon */
    155145
    156146//------------------------------------------------------------------------------
    157 #endif // HAVE_POLL_H
    158 
    159 #endif // XPLCOMMON_POSIXWAITABLE_H
     147#endif // XPLCOMMON_POSIX_WAITABLE_H
    160148
    161149// Local Variables:
Note: See TracChangeset for help on using the changeset viewer.