allAttributesWrapper.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. // Filename: allAttributesWrapper.h
  2. // Created by: drose (21Mar00)
  3. //
  4. ////////////////////////////////////////////////////////////////////
  5. #ifndef ALLATTRIBUTESWRAPPER_H
  6. #define ALLATTRIBUTESWRAPPER_H
  7. #include <pandabase.h>
  8. #include "nodeAttributes.h"
  9. #include <updateSeq.h>
  10. #include <pointerTo.h>
  11. class AllTransitionsWrapper;
  12. ////////////////////////////////////////////////////////////////////
  13. // Class : AllAttributesWrapper
  14. // Description :
  15. ////////////////////////////////////////////////////////////////////
  16. class EXPCL_PANDA AllAttributesWrapper {
  17. public:
  18. typedef AllTransitionsWrapper TransitionWrapper;
  19. typedef AllAttributesWrapper AttributeWrapper;
  20. INLINE AllAttributesWrapper();
  21. INLINE AllAttributesWrapper(const NodeAttributes &attrib);
  22. INLINE AllAttributesWrapper(const AllAttributesWrapper &copy);
  23. INLINE void operator = (const AllAttributesWrapper &copy);
  24. INLINE static AllAttributesWrapper
  25. init_from(const AllTransitionsWrapper &trans);
  26. INLINE ~AllAttributesWrapper();
  27. INLINE bool is_empty() const;
  28. INLINE PT(NodeAttribute) set_attribute(TypeHandle handle,
  29. NodeAttribute *trans);
  30. INLINE PT(NodeAttribute) set_attribute(NodeAttribute *trans);
  31. INLINE PT(NodeAttribute) clear_attribute(TypeHandle handle);
  32. INLINE bool has_attribute(TypeHandle handle) const;
  33. INLINE NodeAttribute *get_attribute(TypeHandle handle) const;
  34. INLINE const NodeAttributes &get_attributes() const;
  35. INLINE NodeAttributes &get_attributes();
  36. INLINE bool is_initial() const;
  37. INLINE int compare_to(const AllAttributesWrapper &other) const;
  38. INLINE void make_initial();
  39. void apply_in_place(const AllTransitionsWrapper &trans);
  40. void apply_from(const AllAttributesWrapper &other,
  41. const AllTransitionsWrapper &trans);
  42. NodeAttributes *apply(const AllTransitionsWrapper &trans) const;
  43. void output(ostream &out) const;
  44. void write(ostream &out, int indent_level = 0) const;
  45. private:
  46. NodeAttributes _attrib;
  47. };
  48. INLINE ostream &operator << (ostream &out, const AllAttributesWrapper &a) {
  49. a.output(out);
  50. return out;
  51. }
  52. template<class Attribute>
  53. INLINE bool
  54. get_attribute_into(Attribute *&ptr, const AllAttributesWrapper &attrib,
  55. TypeHandle transition_type);
  56. #include "allAttributesWrapper.I"
  57. #endif