Node.hpp 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /**
  2. * @file artis/kernel/Node.hpp
  3. * @author See the AUTHORS file
  4. */
  5. /*
  6. * Copyright (C) 2012-2017 ULCO http://www.univ-littoral.fr
  7. *
  8. * This program is free software: you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation, either version 3 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  20. */
  21. #ifndef __ARTIS_KERNEL_NODE_HPP
  22. #define __ARTIS_KERNEL_NODE_HPP
  23. #include <artis/kernel/Any.hpp>
  24. #include <cassert>
  25. namespace artis { namespace kernel {
  26. template < typename U >
  27. class Node
  28. {
  29. public:
  30. Node()
  31. { }
  32. virtual ~Node()
  33. { }
  34. virtual const Any& get(typename U::type t, unsigned int index) const = 0;
  35. virtual std::string get(const ValueTypeID& value_type, typename U::type t,
  36. unsigned int index) const = 0;
  37. virtual const Node < U >* get_submodel(unsigned int /* index */) const
  38. {
  39. assert(false);
  40. return 0;
  41. }
  42. virtual const Node < U >* get_submodel(unsigned int /*index */,
  43. unsigned int /* rank */) const
  44. {
  45. assert(false);
  46. return 0;
  47. }
  48. };
  49. } }
  50. #endif