Implement Read/WriteHelper
[senf.git] / Scheduler / WriteHelper.cti
1 // $Id$
2 //
3 // Copyright (C) 2006 
4
5 // Definition of inline template functions
6
7 //#include "WriteHelper.ih"
8
9 // Custom includes
10 #include "Utils/Exception.hh"
11
12 #define prefix_ inline
13 ///////////////////////////////cti.p///////////////////////////////////////
14
15 template <class Handle>
16 prefix_ typename satcom::lib::WriteHelper<Handle>::ptr
17 satcom::lib::WriteHelper<Handle>::dispatch(Handle handle, std::string data, Callback callback)
18 {
19     return ptr(new WriteHelper(handle, data, callback));
20 }
21
22 template <class Handle>
23 prefix_ Handle satcom::lib::WriteHelper<Handle>::handle()
24     const
25 {
26     return handle_;
27 }
28
29 template <class Handle>
30 prefix_ bool satcom::lib::WriteHelper<Handle>::complete()
31     const
32 {
33     return data_.empty();
34 }
35
36 template <class Handle>
37 prefix_ bool satcom::lib::WriteHelper<Handle>::error()
38     const
39 {
40     return errno_ != 0;
41 }
42
43 template <class Handle>
44 prefix_ void satcom::lib::WriteHelper<Handle>::throw_error()
45     const
46 {
47     if (errno_ != 0)
48         throw satcom::lib::SystemException(errno_);
49 }
50
51
52 ///////////////////////////////cti.e///////////////////////////////////////
53 #undef prefix_
54
55 \f
56 // Local Variables:
57 // mode: c++
58 // End: