OpenDDS  Snapshot(2023/01/24-11:31)
ZeroCopyAllocator_T.cpp
Go to the documentation of this file.
1 /*
2  *
3  *
4  * Distributed under the OpenDDS License.
5  * See: http://www.opendds.org/license.html
6  */
7 
8 #ifndef ZEROCOPYALLOCATOR_T_CPP
9 #define ZEROCOPYALLOCATOR_T_CPP
10 
11 #if !defined (ACE_LACKS_PRAGMA_ONCE)
12 # pragma once
13 #endif /* ACE_LACKS_PRAGMA_ONCE */
14 
15 #include "ZeroCopyAllocator_T.h"
16 
17 #if !defined (__ACE_INLINE__)
18 #include "ZeroCopyAllocator_T.inl"
19 #endif /* __//ACE_INLINE__ */
20 
22 
23 namespace OpenDDS {
24 namespace DCPS {
25 
26 //=============================================================
27 // These methods are no-ops.
28 //=============================================================
29 template <class T, std::size_t N>
30 void *
31 FirstTimeFastAllocator<T, N>::calloc(size_t nbytes, char initial_value)
32 {/* no-op */
33  ACE_UNUSED_ARG(nbytes);
34  ACE_UNUSED_ARG(initial_value);
35  return (void*)0;
36 }
37 
38 template <class T, std::size_t N>
39 void *
40 FirstTimeFastAllocator<T, N>::calloc(size_t n_elem, size_t elem_size, char initial_value)
41 {/* no-op */
42  ACE_UNUSED_ARG(n_elem);
43  ACE_UNUSED_ARG(elem_size);
44  ACE_UNUSED_ARG(initial_value);
45  return (void*)0;
46 }
47 
48 template <class T, std::size_t N>
49 int
51 {/* no-op */
53  ACE_TEXT("(%P|%t) %T not supported %a\n"))) ;
54  return -1;
55 }
56 
57 template <class T, std::size_t N>
58 int
59 FirstTimeFastAllocator<T, N>::bind(const char *name, void *pointer, int duplicates)
60 {/* no-op */
62  ACE_TEXT("(%P|%t) %T not supported %a\n"))) ;
63  ACE_UNUSED_ARG(name);
64  ACE_UNUSED_ARG(pointer);
65  ACE_UNUSED_ARG(duplicates);
66  return -1;
67 }
68 
69 template <class T, std::size_t N>
70 int
71 FirstTimeFastAllocator<T, N>::trybind(const char *name, void *&pointer)
72 {/* no-op */
74  ACE_TEXT("(%P|%t) %T not supported %a\n"))) ;
75  ACE_UNUSED_ARG(name);
76  ACE_UNUSED_ARG(pointer);
77  return -1;
78 }
79 
80 template <class T, std::size_t N>
81 int
82 FirstTimeFastAllocator<T, N>::find(const char *name, void *&pointer)
83 {/* no-op */
85  ACE_TEXT("(%P|%t) %T not supported %a\n"))) ;
86  ACE_UNUSED_ARG(name);
87  ACE_UNUSED_ARG(pointer);
88  return -1;
89 }
90 
91 template <class T, std::size_t N>
92 int
94 {/* no-op */
96  ACE_TEXT("(%P|%t) %T not supported %a\n"))) ;
97  ACE_UNUSED_ARG(name);
98  return -1;
99 }
100 
101 template <class T, std::size_t N>
102 int
104 {/* no-op */
106  ACE_TEXT("(%P|%t) %T not supported %a\n"))) ;
107  ACE_UNUSED_ARG(name);
108  return -1;
109 }
110 
111 template <class T, std::size_t N>
112 int
113 FirstTimeFastAllocator<T, N>::unbind(const char *name, void *&pointer)
114 {/* no-op */
116  ACE_TEXT("(%P|%t) %T not supported %a\n"))) ;
117  ACE_UNUSED_ARG(name);
118  ACE_UNUSED_ARG(pointer);
119  return -1;
120 }
121 
122 template <class T, std::size_t N>
123 int
125 {/* no-op */
127  ACE_TEXT("(%P|%t) %T not supported %a\n"))) ;
128  ACE_UNUSED_ARG(len);
129  ACE_UNUSED_ARG(flags);
130  return -1;
131 }
132 
133 template <class T, std::size_t N>
134 int
135 FirstTimeFastAllocator<T, N>::sync(void *addr, size_t len, int flags)
136 {/* no-op */
138  ACE_TEXT("(%P|%t) %T not supported %a\n"))) ;
139  ACE_UNUSED_ARG(addr);
140  ACE_UNUSED_ARG(len);
141  ACE_UNUSED_ARG(flags);
142  return -1;
143 }
144 
145 template <class T, std::size_t N>
146 int
148 {/* no-op */
150  ACE_TEXT("(%P|%t) %T not supported %a\n"))) ;
151  ACE_UNUSED_ARG(len);
152  ACE_UNUSED_ARG(prot);
153  return -1;
154 }
155 
156 template <class T, std::size_t N>
157 int
158 FirstTimeFastAllocator<T, N>::protect(void *addr, size_t len, int prot)
159 {/* no-op */
161  ACE_TEXT("(%P|%t) %T not supported %a\n"))) ;
162  ACE_UNUSED_ARG(addr);
163  ACE_UNUSED_ARG(len);
164  ACE_UNUSED_ARG(prot);
165  return -1;
166 }
167 
168 #if defined (ACE_HAS_MALLOC_STATS)
169 
170 template <class T, std::size_t N>
171 void
173 {/* no-op */
175  ACE_TEXT("(%P|%t) %T not supported %a\n"))) ;
176 }
177 #endif /* ACE_HAS_MALLOC_STATS */
178 
179 template <class T, std::size_t N>
180 void
182 {/* no-op */
184  ACE_TEXT("(%P|%t) %T not supported %a\n"))) ;
185 }
186 
187 } // namespace DCPS
188 } // namespace OpenDDS
189 
191 
192 #endif /* ZEROCOPYALLOCATOR_T_CPP */
#define ACE_ERROR(X)
virtual int protect(ssize_t len=-1, int prot=PROT_RDWR)
The Internal API and Implementation of OpenDDS.
Definition: AddressCache.h:28
virtual int trybind(const char *name, void *&pointer)
int ssize_t
virtual void * calloc(size_t nbytes, char initial_value='\0')
These methods are no-ops.
virtual int bind(const char *name, void *pointer, int duplicates=0)
virtual int sync(ssize_t len=-1, int flags=MS_SYNC)
#define OPENDDS_END_VERSIONED_NAMESPACE_DECL
virtual int unbind(const char *name)
const char *const name
Definition: debug.cpp:60
ACE_TEXT("TCP_Factory")
LM_ERROR
virtual int find(const char *name, void *&pointer)