Changeset 24:efa33e16e135 in xplcommon


Ignore:
Timestamp:
01/02/13 06:53:35 (11 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
default
hg-Phase:
(<MercurialRepository 2 'hg:/home/ivaradi/xplane/hg/xplcommon' '/'>, 'public')
Message:

Made Completer a FailableReference

Location:
src/xplcommon/win32
Files:
3 edited

Legend:

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

    r22 r24  
    3232//------------------------------------------------------------------------------
    3333
     34#include "../Failable.h"
     35
    3436#include "Overlapped.h"
    3537#include "Overlappable.h"
     
    4749 * object is created and stored in this object.
    4850 */
    49 class Completer
     51class Completer : public ::xplcommon::FailableReference<Completer>
    5052{
    5153protected:
     
    110112     */
    111113    virtual void handleWaitedResult(DWORD size) = 0;
     114
     115private:
     116    /**
     117     * Get the failable object.
     118     */
     119    const ::xplcommon::Failable& getFailable() const;
     120
     121    /**
     122     * Get the failable object.
     123     */
     124    ::xplcommon::Failable& getFailable();
     125
     126    friend class FailableReference<Completer>;
    112127};
    113128
     
    180195//------------------------------------------------------------------------------
    181196
     197inline const ::xplcommon::Failable& Completer::getFailable() const
     198{
     199    return overlappable;
     200}
     201
     202//------------------------------------------------------------------------------
     203
     204inline ::xplcommon::Failable& Completer::getFailable()
     205{
     206    return overlappable;
     207}
     208
     209//------------------------------------------------------------------------------
     210
    182211} /* namespace xplcommon::win32 */ } /* namespace xplcommon */
    183212
  • src/xplcommon/win32/LocalAcceptor.h

    r23 r24  
    4747 * local server socket, i.e. named pipe.
    4848 */
    49 class LocalAcceptor : public Completer,
    50                       public FailableReference<LocalAcceptor>
     49class LocalAcceptor : public Completer
    5150{
    5251private:
     
    114113    virtual void handleWaitedResult(DWORD size);
    115114
    116 private:
    117     /**
    118      * Get the failable object.
    119      */
    120     const ::xplcommon::Failable& getFailable() const;
    121 
    122     /**
    123      * Get the failable object.
    124      */
    125     ::xplcommon::Failable& getFailable();
    126 
    127     friend class FailableReference<LocalAcceptor>;
    128115    friend class LocalServerSocket;
    129116};
     
    163150//------------------------------------------------------------------------------
    164151
    165 inline const ::xplcommon::Failable& LocalAcceptor::getFailable() const
    166 {
    167     return overlappable;
    168 }
    169 
    170 //------------------------------------------------------------------------------
    171 
    172 inline ::xplcommon::Failable& LocalAcceptor::getFailable()
    173 {
    174     return overlappable;
    175 }
    176 
    177 //------------------------------------------------------------------------------
    178 
    179152} /* namespace xplcommon::win32 */ } /* namespace xplcommon */
    180153
  • src/xplcommon/win32/StreamBuffer.h

    r23 r24  
    4747 * Base class for stream reading and writing buffers.
    4848 */
    49 class StreamBuffer : public ::xplcommon::Buffer, public Completer,
    50                      public ::xplcommon::FailableReference<StreamBuffer>
     49class StreamBuffer : public ::xplcommon::Buffer, public Completer
    5150{
    5251protected:
     
    6463     */
    6564    BufferedStream& getStream() const;
    66 
    67 private:
    68     /**
    69      * Get the failable object.
    70      */
    71     const ::xplcommon::Failable& getFailable() const;
    72 
    73     /**
    74      * Get the failable object.
    75      */
    76     ::xplcommon::Failable& getFailable();
    77 
    78     friend class FailableReference<StreamBuffer>;
    7965};
    8066
     
    9884//------------------------------------------------------------------------------
    9985
    100 inline const ::xplcommon::Failable& StreamBuffer::getFailable() const
    101 {
    102     return overlappable;
    103 }
    104 
    105 //------------------------------------------------------------------------------
    106 
    107 inline ::xplcommon::Failable& StreamBuffer::getFailable()
    108 {
    109     return overlappable;
    110 }
    111 
    112 //------------------------------------------------------------------------------
    113 
    11486} /* namespace xplcommon::win32 */ } /* namespace xplcommon */
    11587
Note: See TracChangeset for help on using the changeset viewer.