interrogateElement.I 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259
  1. /**
  2. * PANDA 3D SOFTWARE
  3. * Copyright (c) Carnegie Mellon University. All rights reserved.
  4. *
  5. * All use of this software is subject to the terms of the revised BSD
  6. * license. You should have received a copy of this license along
  7. * with this source code in a file named "LICENSE."
  8. *
  9. * @file interrogateElement.I
  10. * @author drose
  11. * @date 2000-08-11
  12. */
  13. /**
  14. *
  15. */
  16. INLINE InterrogateElement::
  17. InterrogateElement(InterrogateModuleDef *def) :
  18. InterrogateComponent(def)
  19. {
  20. _flags = 0;
  21. _type = 0;
  22. _getter = 0;
  23. _setter = 0;
  24. _has_function = 0;
  25. _clear_function = 0;
  26. _del_function = 0;
  27. _insert_function = 0;
  28. _getkey_function = 0;
  29. _length_function = 0;
  30. _make_property = nullptr;
  31. }
  32. /**
  33. *
  34. */
  35. INLINE InterrogateElement::
  36. InterrogateElement(const InterrogateElement &copy) {
  37. (*this) = copy;
  38. }
  39. /**
  40. *
  41. */
  42. INLINE void InterrogateElement::
  43. operator = (const InterrogateElement &copy) {
  44. InterrogateComponent::operator = (copy);
  45. _flags = copy._flags;
  46. _scoped_name = copy._scoped_name;
  47. _comment = copy._comment;
  48. _type = copy._type;
  49. _getter = copy._getter;
  50. _setter = copy._setter;
  51. _has_function = copy._has_function;
  52. _clear_function = copy._clear_function;
  53. _del_function = copy._del_function;
  54. _insert_function = copy._insert_function;
  55. _getkey_function = copy._getkey_function;
  56. _length_function = copy._length_function;
  57. _make_property = copy._make_property;
  58. }
  59. /**
  60. * Returns true if the element is marked as 'global'. This means only that it
  61. * should appear in the global element list.
  62. */
  63. INLINE bool InterrogateElement::
  64. is_global() const {
  65. return (_flags & F_global) != 0;
  66. }
  67. /**
  68. *
  69. */
  70. INLINE bool InterrogateElement::
  71. has_scoped_name() const {
  72. return !_scoped_name.empty();
  73. }
  74. /**
  75. *
  76. */
  77. INLINE const std::string &InterrogateElement::
  78. get_scoped_name() const {
  79. return _scoped_name;
  80. }
  81. /**
  82. *
  83. */
  84. INLINE bool InterrogateElement::
  85. has_comment() const {
  86. return !_comment.empty();
  87. }
  88. /**
  89. *
  90. */
  91. INLINE const std::string &InterrogateElement::
  92. get_comment() const {
  93. return _comment;
  94. }
  95. /**
  96. *
  97. */
  98. INLINE TypeIndex InterrogateElement::
  99. get_type() const {
  100. return _type;
  101. }
  102. /**
  103. *
  104. */
  105. INLINE bool InterrogateElement::
  106. has_getter() const {
  107. return (_flags & F_has_getter) != 0;
  108. }
  109. /**
  110. *
  111. */
  112. INLINE FunctionIndex InterrogateElement::
  113. get_getter() const {
  114. return _getter;
  115. }
  116. /**
  117. *
  118. */
  119. INLINE bool InterrogateElement::
  120. has_setter() const {
  121. return (_flags & F_has_setter) != 0;
  122. }
  123. /**
  124. *
  125. */
  126. INLINE FunctionIndex InterrogateElement::
  127. get_setter() const {
  128. return _setter;
  129. }
  130. /**
  131. *
  132. */
  133. INLINE bool InterrogateElement::
  134. has_has_function() const {
  135. return (_flags & F_has_has_function) != 0;
  136. }
  137. /**
  138. *
  139. */
  140. INLINE FunctionIndex InterrogateElement::
  141. get_has_function() const {
  142. return _has_function;
  143. }
  144. /**
  145. *
  146. */
  147. INLINE bool InterrogateElement::
  148. has_clear_function() const {
  149. return (_flags & F_has_clear_function) != 0;
  150. }
  151. /**
  152. *
  153. */
  154. INLINE FunctionIndex InterrogateElement::
  155. get_clear_function() const {
  156. return _clear_function;
  157. }
  158. /**
  159. *
  160. */
  161. INLINE bool InterrogateElement::
  162. has_del_function() const {
  163. return (_flags & F_has_del_function) != 0;
  164. }
  165. /**
  166. *
  167. */
  168. INLINE FunctionIndex InterrogateElement::
  169. get_del_function() const {
  170. return _del_function;
  171. }
  172. /**
  173. *
  174. */
  175. INLINE bool InterrogateElement::
  176. has_insert_function() const {
  177. return (_flags & F_has_insert_function) != 0;
  178. }
  179. /**
  180. *
  181. */
  182. INLINE FunctionIndex InterrogateElement::
  183. get_insert_function() const {
  184. return _insert_function;
  185. }
  186. /**
  187. *
  188. */
  189. INLINE bool InterrogateElement::
  190. has_getkey_function() const {
  191. return (_flags & F_has_getkey_function) != 0;
  192. }
  193. /**
  194. *
  195. */
  196. INLINE FunctionIndex InterrogateElement::
  197. get_getkey_function() const {
  198. return _getkey_function;
  199. }
  200. /**
  201. *
  202. */
  203. INLINE bool InterrogateElement::
  204. is_sequence() const {
  205. return (_flags & F_sequence) != 0;
  206. }
  207. /**
  208. *
  209. */
  210. INLINE FunctionIndex InterrogateElement::
  211. get_length_function() const {
  212. return _length_function;
  213. }
  214. /**
  215. *
  216. */
  217. INLINE bool InterrogateElement::
  218. is_mapping() const {
  219. return (_flags & F_mapping) != 0;
  220. }
  221. INLINE std::ostream &
  222. operator << (std::ostream &out, const InterrogateElement &element) {
  223. element.output(out);
  224. return out;
  225. }
  226. INLINE std::istream &
  227. operator >> (std::istream &in, InterrogateElement &element) {
  228. element.input(in);
  229. return in;
  230. }