![]() |
libsesstype
2.0.0
Library for Session Types programming.
|
00001 00005 #ifndef SESSTYPE__PARAMETERISED__NODE_H__ 00006 #define SESSTYPE__PARAMETERISED__NODE_H__ 00007 00008 #include "sesstype/node.h" 00009 #include "sesstype/parameterised/role.h" 00010 00011 #ifdef __cplusplus 00012 namespace sesstype { 00013 namespace parameterised { 00014 namespace util { 00015 00016 class NodeVisitor; 00017 00018 } // namespace util 00019 } // namespace parameterised 00020 } // namespace sesstype 00021 #endif 00022 00023 #ifdef __cplusplus 00024 namespace sesstype { 00025 namespace parameterised { 00026 #endif 00027 00028 #define ST_NODE_FOR 101 00029 #define ST_NODE_ALLREDUCE 102 00030 #define ST_NODE_ONEOF 103 00031 #define ST_NODE_IF 104 00032 00033 #ifdef __cplusplus 00034 class Node : public sesstype::Node { 00035 public: 00037 virtual void accept(util::NodeVisitor &v) = 0; 00038 00039 friend std::ostream &operator<<(std::ostream &os, Node &node); 00040 00041 protected: 00042 explicit Node(unsigned int type) : sesstype::Node(type) { } 00043 00044 private: 00045 virtual void accept(sesstype::util::NodeVisitor &v) override { }; 00046 }; 00047 #endif // __cplusplus 00048 00049 #ifdef __cplusplus 00050 extern "C" { 00051 #endif 00052 00053 #ifdef __cplusplus 00054 typedef Node st_param_node; 00055 #else 00056 typedef struct Node st_param_node; 00057 #endif 00058 00060 void st_param_node_print(st_param_node *const node); 00061 00063 st_param_node *st_param_node_project(st_param_node *const node, st_param_role *const endpoint); 00064 00065 void st_param_node_free(st_param_node *node); 00066 00067 #ifdef __cplusplus 00068 } // extern "C" 00069 #endif 00070 00071 #ifdef __cplusplus 00072 } // namespace parameterised 00073 } // namespace sesstype 00074 #endif 00075 00076 #endif//SESSTYPE__PARAMETERISED__NODE_H__