RCFProto

- Main Page
- Classes
- Files

- File List

All Classes Functions Typedefs
AmiIoHandler.hpp
1
2 //******************************************************************************
3 // RCF - Remote Call Framework
4 //
5 // Copyright (c) 2005 - 2013, Delta V Software. All rights reserved.
6 // http://www.deltavsoft.com
7 //
8 // RCF is distributed under dual licenses - closed source or GPL.
9 // Consult your particular license for conditions of use.
10 //
11 // If you have not purchased a commercial license, you are using RCF
12 // under GPL terms.
13 //
14 // Version: 2.0
15 // Contact: support <at> deltavsoft.com
16 //
17 //******************************************************************************
18
19 #ifndef INCLUDE_RCF_AMIIOHANDLER_HPP
20 #define INCLUDE_RCF_AMIIOHANDLER_HPP
21
22 #include <RCF/Asio.hpp> // AsioErrorCode
23 #include <RCF/OverlappedAmi.hpp>
24
25 namespace RCF {
26
27 class AmiIoHandler
28 {
29 public:
30
31 AmiIoHandler(OverlappedAmiPtr overlappedPtr);
32
33 AmiIoHandler(OverlappedAmiPtr overlappedPtr, const AsioErrorCode & ec);
34
35 void operator()();
36
37 void operator()(
38 const AsioErrorCode & ec);
39
40 void operator()(
41 const AsioErrorCode & ec,
42 std::size_t bytesTransferred);
43
44 OverlappedAmiPtr mOverlappedPtr;
45 std::size_t mIndex;
46
47 AsioErrorCode mEc;
48 };
49
50 class AmiTimerHandler
51 {
52 public:
53
54 AmiTimerHandler(OverlappedAmiPtr overlappedPtr);
55
56 void operator()(const AsioErrorCode & ec);
57
58 OverlappedAmiPtr mOverlappedPtr;
59 std::size_t mIndex;
60 };
61
62 void * asio_handler_allocate(std::size_t size, AmiIoHandler * pHandler);
63 void asio_handler_deallocate(void * pointer, std::size_t size, AmiIoHandler * pHandler);
64 void * asio_handler_allocate(std::size_t size, AmiTimerHandler * pHandler);
65 void asio_handler_deallocate(void * pointer, std::size_t size, AmiTimerHandler * pHandler);
66
67 } // namespace RCF
68
69 #endif // ! INCLUDE_RCF_AMIIOHANDLER_HPP