RCFProto

- Main Page
- Classes
- Files

- File List

All Classes Functions Typedefs
AsioHandlerCache.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_ASIOHANDLERCACHE_HPP
20 #define INCLUDE_RCF_ASIOHANDLERCACHE_HPP
21
22 #include <RCF/Export.hpp>
23 #include <RCF/ThreadLibrary.hpp>
24
25 #include <boost/shared_ptr.hpp>
26
27 #include <vector>
28
29 namespace RCF {
30
31 class RCF_EXPORT AsioHandlerCache
32 {
33 public:
34 typedef boost::shared_ptr< std::vector<char> > VecPtr;
35 Mutex mHandlerMutex;
36 std::vector<VecPtr> mHandlerFreeList;
37 std::vector<VecPtr> mHandlerUsedList;
38
39 AsioHandlerCache();
40 ~AsioHandlerCache();
41
42 void * allocate(std::size_t size);
43 void deallocate(void * pointer, std::size_t size);
44 };
45
46 } // namespace RCF
47
48 #endif // ! INCLUDE_RCF_ASIOHANDLERCACHE_HPP