18 #define FE_SPACE_VERBOSE FALSE 20 typedef int (FnFeAccessSpace)
21 (
const char*,
const char*);
22 typedef int (FnFeSpaceStart)
24 typedef int (FnFeSpaceStop)
26 typedef int (FnFeSpaceWaitForConnection)
28 typedef int (FnFeSpaceFlush)
30 typedef int (FnFeSpaceWaitForUpdate)
32 typedef int (FnFeSpaceLockAfterUpdate)
34 typedef int (FnFeSpaceLock)
36 typedef int (FnFeSpaceUnlock)
38 typedef int (FnFeSpaceSetStateBools)
39 (int,
const char*,
const char*,
const bool*,int);
40 typedef int (FnFeSpaceGetStateBools)
41 (int,
const char*,
const char*,
bool*,int,bool);
42 typedef int (FnFeSpaceSetStateInts)
43 (int,
const char*,
const char*,
const int*,int);
44 typedef int (FnFeSpaceGetStateInts)
45 (int,
const char*,
const char*,
int*,int,bool);
46 typedef int (FnFeSpaceSetStateFloats)
47 (int,
const char*,
const char*,
const float*,int);
48 typedef int (FnFeSpaceGetStateFloats)
49 (int,
const char*,
const char*,
float*,int,bool);
50 typedef int (FnFeSpaceSetStateString)
51 (int,
const char*,
const char*,
const char*);
52 typedef char* (FnFeSpaceGetStateString)
53 (
int,
const char*,
const char*,
bool);
54 typedef int (FnFeSpaceSetStateBytes)
55 (int,
const char*,
const char*,
const unsigned char*,int);
56 typedef unsigned char* (FnFeSpaceGetStateBytes)
57 (
int,
const char*,
const char*,
bool,
int*);
58 typedef int (FnFeSpaceSendMessageString)
59 (int,
const char*,
const char*);
60 typedef char* (FnFeSpaceNextMessageString)
62 typedef int (FnFeFreeString)
65 inline FnFeAccessSpace*& fpFeAccessSpace(
void)
67 static FnFeAccessSpace* s_fpFeAccessSpace=NULL;
68 return s_fpFeAccessSpace;
71 inline FnFeSpaceStart*& fpFeSpaceStart(
void)
73 static FnFeSpaceStart* s_fpFeSpaceStart=NULL;
74 return s_fpFeSpaceStart;
77 inline FnFeSpaceStop*& fpFeSpaceStop(
void)
79 static FnFeSpaceStop* s_fpFeSpaceStop=NULL;
80 return s_fpFeSpaceStop;
83 inline FnFeSpaceWaitForConnection*& fpFeSpaceWaitForConnection(
void)
85 static FnFeSpaceWaitForConnection* s_fpFeSpaceWaitForConnection=NULL;
86 return s_fpFeSpaceWaitForConnection;
89 inline FnFeSpaceFlush*& fpFeSpaceFlush(
void)
91 static FnFeSpaceFlush* s_fpFeSpaceFlush=NULL;
92 return s_fpFeSpaceFlush;
95 inline FnFeSpaceWaitForUpdate*& fpFeSpaceWaitForUpdate(
void)
97 static FnFeSpaceWaitForUpdate* s_fpFeSpaceWaitForUpdate=NULL;
98 return s_fpFeSpaceWaitForUpdate;
101 inline FnFeSpaceLockAfterUpdate*& fpFeSpaceLockAfterUpdate(
void)
103 static FnFeSpaceLockAfterUpdate* s_fpFeSpaceLockAfterUpdate=NULL;
104 return s_fpFeSpaceLockAfterUpdate;
107 inline FnFeSpaceLock*& fpFeSpaceLock(
void)
109 static FnFeSpaceLock* s_fpFeSpaceLock=NULL;
110 return s_fpFeSpaceLock;
113 inline FnFeSpaceUnlock*& fpFeSpaceUnlock(
void)
115 static FnFeSpaceUnlock* s_fpFeSpaceUnlock=NULL;
116 return s_fpFeSpaceUnlock;
119 inline FnFeSpaceSetStateBools*& fpFeSpaceSetStateBools(
void)
121 static FnFeSpaceSetStateBools* s_fpFeSpaceSetStateBools=NULL;
122 return s_fpFeSpaceSetStateBools;
125 inline FnFeSpaceGetStateBools*& fpFeSpaceGetStateBools(
void)
127 static FnFeSpaceGetStateBools* s_fpFeSpaceGetStateBool=NULL;
128 return s_fpFeSpaceGetStateBool;
131 inline FnFeSpaceSetStateInts*& fpFeSpaceSetStateInts(
void)
133 static FnFeSpaceSetStateInts* s_fpFeSpaceSetStateInts=NULL;
134 return s_fpFeSpaceSetStateInts;
137 inline FnFeSpaceGetStateInts*& fpFeSpaceGetStateInts(
void)
139 static FnFeSpaceGetStateInts* s_fpFeSpaceGetStateInts=NULL;
140 return s_fpFeSpaceGetStateInts;
143 inline FnFeSpaceSetStateFloats*& fpFeSpaceSetStateFloats(
void)
145 static FnFeSpaceSetStateFloats* s_fpFeSpaceSetStateFloats=NULL;
146 return s_fpFeSpaceSetStateFloats;
149 inline FnFeSpaceGetStateFloats*& fpFeSpaceGetStateFloats(
void)
151 static FnFeSpaceGetStateFloats* s_fpFeSpaceGetStateFloats=NULL;
152 return s_fpFeSpaceGetStateFloats;
155 inline FnFeSpaceSetStateString*& fpFeSpaceSetStateString(
void)
157 static FnFeSpaceSetStateString* s_fpFeSpaceSetStateString=NULL;
158 return s_fpFeSpaceSetStateString;
161 inline FnFeSpaceGetStateString*& fpFeSpaceGetStateString(
void)
163 static FnFeSpaceGetStateString* s_fpFeSpaceGetStateString=NULL;
164 return s_fpFeSpaceGetStateString;
167 inline FnFeSpaceSetStateBytes*& fpFeSpaceSetStateBytes(
void)
169 static FnFeSpaceSetStateBytes* s_fpFeSpaceSetStateBytes=NULL;
170 return s_fpFeSpaceSetStateBytes;
173 inline FnFeSpaceGetStateBytes*& fpFeSpaceGetStateBytes(
void)
175 static FnFeSpaceGetStateBytes* s_fpFeSpaceGetStateBytes=NULL;
176 return s_fpFeSpaceGetStateBytes;
179 inline FnFeSpaceSendMessageString*& fpFeSpaceSendMessageString(
void)
181 static FnFeSpaceSendMessageString* s_fpFeSpaceSendMessageString=NULL;
182 return s_fpFeSpaceSendMessageString;
185 inline FnFeSpaceNextMessageString*& fpFeSpaceNextMessageString(
void)
187 static FnFeSpaceNextMessageString* s_fpFeSpaceNextMessageString=NULL;
188 return s_fpFeSpaceNextMessageString;
191 inline FnFeFreeString*& fpFeFreeString(
void)
193 static FnFeFreeString* s_fpFeFreeString=NULL;
194 return s_fpFeFreeString;
198 inline void* fe_nethost_dlsym(HINSTANCE a_handle,
const char* a_symbol)
200 return GetProcAddress(a_handle,a_symbol);
203 inline void* fe_nethost_dlsym(
void* a_handle,
const char* a_symbol)
205 return dlsym(a_handle,a_symbol);
209 inline int fe_nethost_nethost_loader_init(
void)
211 const int size(4096);
215 #ifdef FE_BINARY_SUFFIX 216 #define AS_STRING2(x) #x 217 #define AS_STRING(x) AS_STRING2(x) 219 strncpy(suffix,AS_STRING(FE_BINARY_SUFFIX),
size);
224 const unsigned long cp=
225 GetEnvironmentVariable(
"FE_BINARY_SUFFIX", val,
size);
228 strncpy(suffix,val,
size);
231 char filename[
size+100];
232 snprintf(filename,
size,
"fexNetworkHostDL%s.dll",suffix);
234 HINSTANCE handle=LoadLibrary(filename);
238 printf(
"fe_nethost_nethost_loader_init LoadLibrary \"%s\" failed\n",
243 const char* cp=getenv(
"FE_BINARY_SUFFIX");
246 strncpy(suffix,cp,
size);
249 char filename[
size+100];
250 snprintf(filename,
size,
"libfexNetworkHostDL%s.so",suffix);
253 void* handle=dlopen(filename,RTLD_NOW);
256 printf(
"fe_nethost_nethost_loader_init dlopen \"%s\" failed\n %s\n",
262 #pragma GCC diagnostic push 263 #pragma GCC diagnostic ignored "-Wconditionally-supported" 265 fpFeAccessSpace()=(FnFeAccessSpace*)
266 fe_nethost_dlsym(handle,
"fe_nethost_access_space");
267 fpFeSpaceStart()=(FnFeSpaceStart*)
268 fe_nethost_dlsym(handle,
"fe_nethost_space_start");
269 fpFeSpaceStop()=(FnFeSpaceStop*)
270 fe_nethost_dlsym(handle,
"fe_nethost_space_stop");
271 fpFeSpaceWaitForConnection()=(FnFeSpaceWaitForConnection*)
272 fe_nethost_dlsym(handle,
"fe_nethost_space_wait_for_connection");
273 fpFeSpaceFlush()=(FnFeSpaceFlush*)
274 fe_nethost_dlsym(handle,
"fe_nethost_space_flush");
275 fpFeSpaceWaitForUpdate()=(FnFeSpaceWaitForUpdate*)
276 fe_nethost_dlsym(handle,
"fe_nethost_space_wait_for_update");
277 fpFeSpaceLockAfterUpdate()=(FnFeSpaceLockAfterUpdate*)
278 fe_nethost_dlsym(handle,
"fe_nethost_space_lock_after_update");
279 fpFeSpaceLock()=(FnFeSpaceLock*)
280 fe_nethost_dlsym(handle,
"fe_nethost_space_lock");
281 fpFeSpaceUnlock()=(FnFeSpaceUnlock*)
282 fe_nethost_dlsym(handle,
"fe_nethost_space_unlock");
283 fpFeSpaceSetStateBools()=(FnFeSpaceSetStateBools*)
284 fe_nethost_dlsym(handle,
"fe_nethost_space_set_state_bools");
285 fpFeSpaceGetStateBools()=(FnFeSpaceGetStateBools*)
286 fe_nethost_dlsym(handle,
"fe_nethost_space_get_state_bools");
287 fpFeSpaceSetStateInts()=(FnFeSpaceSetStateInts*)
288 fe_nethost_dlsym(handle,
"fe_nethost_space_set_state_ints");
289 fpFeSpaceGetStateInts()=(FnFeSpaceGetStateInts*)
290 fe_nethost_dlsym(handle,
"fe_nethost_space_get_state_ints");
291 fpFeSpaceSetStateFloats()=(FnFeSpaceSetStateFloats*)
292 fe_nethost_dlsym(handle,
"fe_nethost_space_set_state_floats");
293 fpFeSpaceGetStateFloats()=(FnFeSpaceGetStateFloats*)
294 fe_nethost_dlsym(handle,
"fe_nethost_space_get_state_floats");
295 fpFeSpaceSetStateString()=(FnFeSpaceSetStateString*)
296 fe_nethost_dlsym(handle,
"fe_nethost_space_set_state_string");
297 fpFeSpaceGetStateString()=(FnFeSpaceGetStateString*)
298 fe_nethost_dlsym(handle,
"fe_nethost_space_get_state_string");
299 fpFeSpaceSetStateBytes()=(FnFeSpaceSetStateBytes*)
300 fe_nethost_dlsym(handle,
"fe_nethost_space_set_state_bytes");
301 fpFeSpaceGetStateBytes()=(FnFeSpaceGetStateBytes*)
302 fe_nethost_dlsym(handle,
"fe_nethost_space_get_state_bytes");
303 fpFeSpaceSendMessageString()=(FnFeSpaceSendMessageString*)
304 fe_nethost_dlsym(handle,
"fe_nethost_space_send_message_string");
305 fpFeSpaceNextMessageString()=(FnFeSpaceNextMessageString*)
306 fe_nethost_dlsym(handle,
"fe_nethost_space_next_message_string");
307 fpFeFreeString()=(FnFeFreeString*)
308 fe_nethost_dlsym(handle,
"fe_nethost_free_string");
310 #pragma GCC diagnostic pop 315 inline int fe_nethost_access_space(
const char* a_name,
const char* a_implementation)
317 if(!fpFeAccessSpace())
319 fe_nethost_nethost_loader_init();
322 return fpFeAccessSpace() &&
323 fpFeAccessSpace()(a_name,a_implementation);
326 inline int fe_nethost_access_space(
const char* a_name)
328 return fe_nethost_access_space(a_name,
"*.NetworkCatalog");
331 inline int fe_nethost_space_start(
int a_spaceIndex)
333 return fpFeSpaceStart() && fpFeSpaceStart()(a_spaceIndex);
336 inline int fe_nethost_space_stop(
int a_spaceIndex)
338 return fpFeSpaceStop() && fpFeSpaceStop()(a_spaceIndex);
341 inline int fe_nethost_space_wait_for_connection(
int a_spaceIndex)
343 return fpFeSpaceWaitForConnection() &&
344 fpFeSpaceWaitForConnection()(a_spaceIndex);
347 inline int fe_nethost_space_flush(
int a_spaceIndex)
349 return fpFeSpaceFlush() && fpFeSpaceFlush()(a_spaceIndex);
352 inline int fe_nethost_space_wait_for_update(
int a_spaceIndex,
353 int* a_pFlushCount,
int* a_pSpins)
355 return fpFeSpaceWaitForUpdate() &&
356 fpFeSpaceWaitForUpdate()(a_spaceIndex,a_pFlushCount,a_pSpins);
359 inline int fe_nethost_space_lock_after_update(
int a_spaceIndex,
360 int* a_pFlushCount,
int* a_pSpins)
362 return fpFeSpaceLockAfterUpdate() &&
363 fpFeSpaceLockAfterUpdate()(a_spaceIndex,
364 a_pFlushCount,a_pSpins);
367 inline int fe_nethost_space_lock(
int a_spaceIndex)
369 return fpFeSpaceLock() && fpFeSpaceLock()(a_spaceIndex);
372 inline int fe_nethost_space_unlock(
int a_spaceIndex)
374 return fpFeSpaceUnlock() && fpFeSpaceUnlock()(a_spaceIndex);
378 int fe_nethost_space_set_state(
int a_spaceIndex,
379 const char* a_key,
const char* a_property,
const T* a_values,
int a_count)
382 printf(
"fe_nethost_space_set_state<%s *> %d \"%s\" \"%s\" %d (NOP)\n",
383 typeid(T).name(),a_spaceIndex,a_key,a_property,a_count);
389 int fe_nethost_space_set_state(
int a_spaceIndex,
390 const char* a_key,
const char* a_property,
const T a_value)
393 printf(
"fe_nethost_space_set_state<%s> %d \"%s\" \"%s\"\n",
394 typeid(T).name(),a_spaceIndex,a_key,a_property);
396 return fe_nethost_space_set_state(a_spaceIndex,a_key,a_property,&a_value,1);
400 int fe_nethost_space_set_state(
int a_spaceIndex,
401 const char* a_key,
const T a_value)
404 printf(
"fe_nethost_space_set_state<%s> %d \"%s\"\n",
405 typeid(T).name(),a_spaceIndex,a_key);
407 return fe_nethost_space_set_state<T>(a_spaceIndex,a_key,
"value",a_value);
411 int fe_nethost_space_set_state(
int a_spaceIndex,
412 const char* a_key,T* a_value)
415 printf(
"fe_nethost_space_set_state<%s *> %d \"%s\"\n",
416 typeid(T).name(),a_spaceIndex,a_key);
418 return fe_nethost_space_set_state<const T*>(a_spaceIndex,a_key,
"value",a_value);
422 int fe_nethost_space_set_state(
int a_spaceIndex,
423 const char* a_key,
const T* a_values,
int a_count)
426 printf(
"fe_nethost_space_set_state<%s *> %d \"%s\" %d\n",
427 typeid(T).name(),a_spaceIndex,a_key,a_count);
429 return fe_nethost_space_set_state(a_spaceIndex,a_key,
"value",
434 int fe_nethost_space_get_state(
int a_spaceIndex,
435 const char* a_key,
const char* a_property,T a_value,
int a_size,
bool a_safe)
438 printf(
"fe_nethost_space_get_state<%s> \"%s\" \"%s\" (NOP)\n",
439 typeid(T).name(),a_key,a_property);
445 int fe_nethost_space_get_state(
int a_spaceIndex,
446 const char* a_key,T a_value,
int a_size,
bool a_safe)
448 return fe_nethost_space_get_state(a_spaceIndex,a_key,
"value",
449 a_value,a_size,a_safe);
453 int fe_nethost_space_get_state_dynamic(
int a_spaceIndex,
454 const char* a_key,
const char* a_property,T* a_pPointer,
bool a_safe)
457 printf(
"fe_nethost_space_get_state_dynamic<%s> \"%s\" \"%s\" (NOP)\n",
458 typeid(T).name(),a_key,a_property);
464 int fe_nethost_space_get_state(
int a_spaceIndex,
465 const char* a_key,
const char* a_property,
466 T* a_values,
int a_count,
bool a_safe)
469 printf(
"fe_nethost_space_get_state<%s> \"%s\" \"%s\" (NOP)\n",
470 typeid(T).name(),a_key,a_property);
476 int fe_nethost_space_get_state(
int a_spaceIndex,
477 const char* a_key,T* a_values,
int a_count,
bool a_safe)
479 return fe_nethost_space_get_state(a_spaceIndex,a_key,
"value",
480 a_values,a_count,a_safe);
484 int fe_nethost_space_send_message(
int a_spaceIndex,
485 const char* a_key,
const T a_value)
488 printf(
"fe_nethost_space_send_message<%s> \"%s\" (NOP)\n",
489 typeid(T).name(),a_key);
495 T* fe_nethost_space_next_message(
int a_spaceIndex,
const char* a_key)
498 printf(
"fe_nethost_space_next_message<%s> \"%s\" (NOP)\n",
499 typeid(T).name(),a_key);
506 int fe_nethost_space_set_state(
int a_spaceIndex,
507 const char* a_key,
const char* a_property,
const bool* a_values,
int a_count)
509 return fpFeSpaceSetStateBools() &&
510 fpFeSpaceSetStateBools()(a_spaceIndex,a_key,a_property,
515 int fe_nethost_space_get_state(
int a_spaceIndex,
516 const char* a_key,
const char* a_property,
517 bool* a_values,
int a_count,
bool a_safe)
519 return fpFeSpaceGetStateBools() &&
520 fpFeSpaceGetStateBools()(a_spaceIndex,a_key,a_property,
521 a_values,a_count,a_safe);
526 int fe_nethost_space_set_state(
int a_spaceIndex,
527 const char* a_key,
const char* a_property,
const int* a_values,
int a_count)
529 return fpFeSpaceSetStateInts() &&
530 fpFeSpaceSetStateInts()(a_spaceIndex,a_key,a_property,
535 int fe_nethost_space_get_state(
int a_spaceIndex,
536 const char* a_key,
const char* a_property,
537 int* a_values,
int a_count,
bool a_safe)
539 return fpFeSpaceGetStateInts() &&
540 fpFeSpaceGetStateInts()(a_spaceIndex,a_key,a_property,
541 a_values,a_count,a_safe);
546 int fe_nethost_space_set_state(
int a_spaceIndex,
547 const char* a_key,
const char* a_property,
const float* a_values,
int a_count)
549 return fpFeSpaceSetStateFloats() &&
550 fpFeSpaceSetStateFloats()(a_spaceIndex,a_key,a_property,
555 int fe_nethost_space_get_state(
int a_spaceIndex,
556 const char* a_key,
const char* a_property,
557 float* a_values,
int a_count,
bool a_safe)
559 return fpFeSpaceGetStateFloats() &&
560 fpFeSpaceGetStateFloats()(a_spaceIndex,a_key,a_property,
561 a_values,a_count,a_safe);
566 int fe_nethost_space_set_state(
int a_spaceIndex,
567 const char* a_key,
const char* a_property,
const char* a_value)
570 printf(
"fe_nethost_space_set_state<const char*> %d \"%s\" \"%s\" \"%s\"\n",
571 a_spaceIndex,a_key,a_property,a_value);
573 return fpFeSpaceSetStateString() &&
574 fpFeSpaceSetStateString()(a_spaceIndex,a_key,a_property,
579 int fe_nethost_space_get_state(
int a_spaceIndex,
580 const char* a_key,
const char* a_property,
581 char* a_value,
int a_size,
bool a_safe)
583 if(!fpFeSpaceGetStateString())
589 fpFeSpaceGetStateString()(a_spaceIndex,a_key,a_property,a_safe);
595 strncpy(a_value,buffer,a_size-1);
603 int fe_nethost_space_get_state_dynamic(
int a_spaceIndex,
604 const char* a_key,
const char* a_property,
605 char** a_pValue,
bool a_safe)
609 if(!fpFeSpaceGetStateString())
615 fpFeSpaceGetStateString()(a_spaceIndex,a_key,a_property,a_safe);
617 printf(
"fe_nethost_space_get_state_dynamic<char*> buffer \"%s\"\n",
625 *a_pValue=strdup(buffer);
627 return strlen(*a_pValue);
632 int fe_nethost_space_set_state(
int a_spaceIndex,
633 const char* a_key,
const char* a_property,
634 const unsigned char* a_value,
int a_size)
637 printf(
"fe_nethost_space_set_state<const uchar*> %d \"%s\" \"%s\"\n",
638 a_spaceIndex,a_key,a_property);
641 return fpFeSpaceSetStateBytes() &&
642 fpFeSpaceSetStateBytes()(a_spaceIndex,a_key,a_property,
647 int fe_nethost_space_get_state(
int a_spaceIndex,
648 const char* a_key,
const char* a_property,
649 unsigned char* a_value,
int a_size,
bool a_safe)
651 if(!fpFeSpaceGetStateBytes())
657 unsigned char* buffer=fpFeSpaceGetStateBytes()(
658 a_spaceIndex,a_key,a_property,a_safe,&bytesRead);
664 int bytesCopied=a_size<bytesRead? a_size: bytesRead;
665 memcpy(a_value,buffer,bytesCopied);
672 int fe_nethost_space_get_state_dynamic(
int a_spaceIndex,
673 const char* a_key,
const char* a_property,
674 unsigned char** a_pValue,
bool a_safe)
678 if(!fpFeSpaceGetStateBytes())
684 unsigned char* buffer=fpFeSpaceGetStateBytes()(
685 a_spaceIndex,a_key,a_property,a_safe,&bytesRead);
691 *a_pValue=(
unsigned char*)malloc(bytesRead);
692 memcpy(*a_pValue,buffer,bytesRead);
699 int fe_nethost_space_send_message(
int a_spaceIndex,
700 const char* a_key,
const char* a_value)
702 return fpFeSpaceSendMessageString() &&
703 fpFeSpaceSendMessageString()(a_spaceIndex,a_key,a_value);
707 char* fe_nethost_space_next_message(
int a_spaceIndex,
const char* a_key)
709 if(!fpFeSpaceNextMessageString())
714 return fpFeSpaceNextMessageString()(a_spaceIndex,a_key);
728 ScopedBuffer(T a_pBuffer,
int a_size):
729 m_pBuffer(a_pBuffer),
731 m_pCount(&m_countBacking),
734 ScopedBuffer(
const ScopedBuffer<T>& a_rOther):
735 m_pBuffer(a_rOther.m_pBuffer),
736 m_size(a_rOther.m_size),
737 m_pCount(a_rOther.m_pCount),
743 if(!(--(*m_pCount))) free(m_pBuffer);
746 const T data(
void)
const {
return m_pBuffer; }
747 int size(
void)
const {
return m_size; }
759 Atomic(Space& a_rSpace):
764 printf(
"Space::Atomic::Atomic failed to lock\n");
767 Atomic(Space& a_rSpace,
int& a_rFlushCount):
770 if(!m_rSpace.lockAfterUpdate(a_rFlushCount,m_spinCount))
772 printf(
"Space::Atomic::Atomic failed to lock\n");
777 if(!m_rSpace.unlock())
779 printf(
"Space::Atomic::~Atomic failed to unlock\n");
784 int getState(
const char* a_key,
const char* a_property,
785 T a_value,
int a_size)
const 786 {
return m_rSpace.getStateUnsafe(a_key,a_property,
790 int getState(
const char* a_key,T a_value,
int a_size)
const 791 {
return getState(a_key,
"value",a_value,a_size); }
794 ScopedBuffer<T> getStateScoped(
const char* a_key,
795 const char* a_property)
const 796 {
return m_rSpace.getStateScopedUnsafe<T>(a_key,a_property); }
799 ScopedBuffer<T> getStateScoped(
const char* a_key)
const 800 {
return getStateScoped<T>(a_key,
"value"); }
802 int spinCount(
void)
const 803 {
return m_spinCount; }
810 Space(
int a_spaceIndex):
811 m_spaceIndex(a_spaceIndex) {}
813 int start(
void) {
return fe_nethost_space_start(m_spaceIndex); }
814 int stop(
void) {
return fe_nethost_space_stop(m_spaceIndex); }
816 int waitForConnection(
void)
817 {
return fe_nethost_space_wait_for_connection(m_spaceIndex); }
819 int flush(
void) {
return fe_nethost_space_flush(m_spaceIndex); }
821 int lock(
void) {
return fe_nethost_space_lock(m_spaceIndex); }
822 int unlock(
void) {
return fe_nethost_space_unlock(m_spaceIndex); }
824 int waitForUpdate(
int& a_rFlushCount,
int& a_rSpins)
825 {
return fe_nethost_space_wait_for_update(m_spaceIndex,
826 &a_rFlushCount,&a_rSpins); }
827 int waitForUpdate(
int& a_rFlushCount)
829 return fe_nethost_space_wait_for_update(m_spaceIndex,
830 &a_rFlushCount,&spinCount); }
832 int lockAfterUpdate(
int& a_rFlushCount,
int& a_rSpins)
833 {
return fe_nethost_space_lock_after_update(m_spaceIndex,
834 &a_rFlushCount,&a_rSpins); }
835 int lockAfterUpdate(
int& a_rFlushCount)
837 return fe_nethost_space_lock_after_update(m_spaceIndex,
838 &a_rFlushCount,&spinCount); }
841 int setState(
const char* a_key,
const char* a_property,
const T a_value)
842 {
return fe_nethost_space_set_state(m_spaceIndex,a_key,a_property,
846 int setState(
const char* a_key,
const T a_value)
847 {
return fe_nethost_space_set_state(m_spaceIndex,a_key,a_value); }
850 int setState(
const char* a_key,
const char* a_property,
851 const T a_value,
int a_size)
852 {
return fe_nethost_space_set_state(m_spaceIndex,a_key,a_property,
856 int setState(
const char* a_key,
const T a_value,
int a_size)
857 {
return fe_nethost_space_set_state(m_spaceIndex,a_key,
861 int getState(
const char* a_key,
const char* a_property,
862 T a_value,
int a_size)
const 863 {
return fe_nethost_space_get_state(m_spaceIndex,a_key,a_property,
864 a_value,a_size,
true); }
867 int getState(
const char* a_key,T a_value,
int a_size)
const 868 {
return fe_nethost_space_get_state(m_spaceIndex,a_key,
869 a_value,a_size,
true); }
872 int getStateUnsafe(
const char* a_key,
const char* a_property,
873 T a_value,
int a_size)
const 874 {
return fe_nethost_space_get_state(m_spaceIndex,
875 a_key,a_property,a_value,a_size,
false); }
878 ScopedBuffer<T> getStateScoped(
const char* a_key,
879 const char* a_property)
const 883 fe_nethost_space_get_state_dynamic<T>(m_spaceIndex,
884 a_key,a_property,&pPointer,
true);
885 return ScopedBuffer<T>(pPointer,size);
889 ScopedBuffer<T> getStateScoped(
const char* a_key)
const 890 {
return getStateScoped<T>(a_key,
"value"); }
893 ScopedBuffer<T> getStateScopedUnsafe(
const char* a_key,
894 const char* a_property)
const 898 fe_nethost_space_get_state_dynamic<T>(m_spaceIndex,
899 a_key,a_property,&pPointer,
false);
900 return ScopedBuffer<T>(pPointer,size);
904 ScopedBuffer<T> getStateScopedUnsafe(
const char* a_key)
const 905 {
return getStateScopedUnsafe<T>(a_key,
"value"); }
908 int sendMessage(
const char* a_key,
const T* a_value)
909 {
return fe_nethost_space_send_message(m_spaceIndex,
916 inline Space accessSpace(
const char* a_name,
917 const char* a_implementation=
"*.NetworkCatalog")
919 return Space(fe_nethost_access_space(a_name,a_implementation));
U32 size(const DenseVector< T > &lhs)
Return number of elements.
Definition: DenseVector.h:587
Definition: nethost_loader.h:717