Changeset 11837 for trunk/FACT++/src/DimDescriptionService.h
- Timestamp:
- 08/07/11 18:43:13 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/DimDescriptionService.h
r11246 r11837 2 2 #define FACT_DimDescriptionService 3 3 4 #include <array> 4 5 #include <string> 5 6 #include <vector> 6 7 8 class Time; 7 9 class DimService; 8 10 … … 45 47 } 46 48 47 template<class T> 48 void Update(const T &data) 49 void setData(const void *ptr, size_t sz) 49 50 { 50 //cout << "Update: " << svc.getName() << " (" << sizeof(T) << ")" << endl; 51 setData(const_cast<T*>(&data), sizeof(T)); 52 updateService(); 51 DimService::setData(const_cast<void*>(ptr), sz); 53 52 } 54 53 55 54 template<typename T> 56 void Update(const std::vector<T> &data)55 void setData(const std::vector<T> &data) 57 56 { 58 //std::cout << "Update: " << getName() << " " << data.size() << " " << sizeof(T) << std::endl; 59 setData(const_cast<T*>(data.data()), data.size()*sizeof(T)); 60 updateService(); 57 setData(data.data(), data.size()*sizeof(T)); 58 } 59 60 template<class T, size_t N> 61 void setData(const std::array<T, N> &data) 62 { 63 setData(data.data(), N*sizeof(T)); 64 } 65 66 void setTime(const Time &t); 67 void setTime(); 68 69 int Update(); 70 int Update(const Time &t); 71 int Update(const std::string &data); 72 int Update(const char *data); 73 74 template<class T> 75 int Update(const T &data) 76 { 77 setData(&data, sizeof(T)); 78 return Update(); 79 } 80 81 template<typename T> 82 int Update(const std::vector<T> &data) 83 { 84 setData(data); 85 return Update(); 86 } 87 88 template<class T, size_t N> 89 int Update(const std::array<T, N> &data) 90 { 91 setData(data); 92 return Update(); 61 93 } 62 94 63 95 // FIXME: Implement callback with boost::function instead of Pointer to this 64 65 96 }; 66 97
Note:
See TracChangeset
for help on using the changeset viewer.