00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef _MBSIM_FUNCTION_H_
00019 #define _MBSIM_FUNCTION_H_
00020
00021 #include "mbsim/element.h"
00022 #include "fmatvec/function.h"
00023 #include <string>
00024 #include <xercesc/dom/DOMElement.hpp>
00025
00026 namespace {
00027 std::string uniqueDummyName(void *p) {
00028 std::stringstream str;
00029 str<<"Function_"<<p;
00030 return str.str();
00031 }
00032 }
00033
00034 namespace MBSim {
00035
00037 class FunctionBase : public Element {
00038 public:
00041 FunctionBase() : Element(uniqueDummyName(this)) {}
00042 };
00043
00047 template<typename Sig>
00048 class Function : public fmatvec::Function<Sig>, public FunctionBase {
00049 public:
00052 Function() : fmatvec::Function<Sig>(), FunctionBase() {}
00053
00054 void initializeUsingXML(xercesc::DOMElement *element);
00055 };
00056
00057 template<typename Sig>
00058 void Function<Sig>::initializeUsingXML(xercesc::DOMElement *element) {
00059 if(MBXMLUtils::E(element)->hasAttribute("name"))
00060 THROW_MBSIMERROR("No 'name' attribute allowed for Function's.");
00061 }
00062
00063 }
00064
00065 #endif