Choreonoid  1.8
StdBodyFileUtil.h
Go to the documentation of this file.
1 #ifndef CNOID_BODY_STD_BODY_FILE_UTIL_H
2 #define CNOID_BODY_STD_BODY_FILE_UTIL_H
3 
4 #include "StdBodyLoader.h"
5 #include "StdBodyWriter.h"
6 
7 namespace cnoid {
8 
9 template<class DeviceType>
11 {
13  const char* typeName,
14  std::function<bool(StdBodyLoader* loader, const Mapping* info)> readFunction,
15  std::function<bool(StdBodyWriter* writer, Mapping* info, const DeviceType* device)> writeFunction)
16  {
17  if(readFunction){
18  StdBodyLoader::registerNodeType(typeName, readFunction);
19  }
20  if(writeFunction){
21  StdBodyWriter::registerDeviceWriter<DeviceType>(typeName, writeFunction);
22  }
23  }
24 };
25 
26 }
27 
28 #endif
cnoid::StdBodyLoader::registerNodeType
static void registerNodeType(const char *typeName, std::function< bool(StdBodyLoader *loader, const Mapping *info)> readFunction)
Definition: StdBodyLoader.cpp:1917
cnoid::Mapping
Definition: ValueTree.h:253
cnoid::StdBodyFileDeviceTypeRegistration
Definition: StdBodyFileUtil.h:10
cnoid::StdBodyFileDeviceTypeRegistration::StdBodyFileDeviceTypeRegistration
StdBodyFileDeviceTypeRegistration(const char *typeName, std::function< bool(StdBodyLoader *loader, const Mapping *info)> readFunction, std::function< bool(StdBodyWriter *writer, Mapping *info, const DeviceType *device)> writeFunction)
Definition: StdBodyFileUtil.h:12
cnoid
Definition: AbstractSceneLoader.h:11
cnoid::StdBodyWriter
Definition: StdBodyWriter.h:16
cnoid::StdBodyLoader
Definition: StdBodyLoader.h:20
StdBodyWriter.h
StdBodyLoader.h