open_toontown_panda3d/panda/src/dgraph/buttonEventDataAttribute.h

82 lines
2.2 KiB
C++

// Filename: buttonEventDataAttribute.h
// Created by: drose (27Mar00)
//
////////////////////////////////////////////////////////////////////
#ifndef BUTTONEVENTDATAATTRIBUTE_H
#define BUTTONEVENTDATAATTRIBUTE_H
#include <pandabase.h>
#include <nodeAttribute.h>
#include <buttonEvent.h>
#include <vector>
class ButtonEventDataTransition;
////////////////////////////////////////////////////////////////////
// Class : ButtonEventDataAttribute
// Description : This data graph attribute stores a collection of
// button events that have been generated by the user
// since the last time the data graph pulsed, in the
// order they were generated.
////////////////////////////////////////////////////////////////////
class EXPCL_PANDA ButtonEventDataAttribute : public NodeAttribute {
private:
typedef vector<ButtonEvent> Buttons;
public:
INLINE ButtonEventDataAttribute();
INLINE ButtonEventDataAttribute(const ButtonEventDataAttribute &copy);
INLINE void operator = (const ButtonEventDataAttribute &copy);
public:
// Functions to access and manipulate the set of buttons.
typedef Buttons::const_iterator const_iterator;
typedef Buttons::const_iterator iterator;
INLINE const_iterator begin() const;
INLINE const_iterator end() const;
INLINE void clear();
INLINE void push_back(const ButtonEvent &event);
public:
virtual NodeAttribute *make_copy() const;
virtual NodeAttribute *make_initial() const;
virtual TypeHandle get_handle() const;
virtual void output(ostream &out) const;
virtual void write(ostream &out, int indent_level = 0) const;
protected:
virtual int internal_compare_to(const NodeAttribute *other) const;
private:
Buttons _buttons;
public:
virtual TypeHandle get_type() const {
return get_class_type();
}
virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
static TypeHandle get_class_type() {
return _type_handle;
}
static void init_type() {
NodeAttribute::init_type();
register_type(_type_handle, "ButtonEventDataAttribute",
NodeAttribute::get_class_type());
}
private:
static TypeHandle _type_handle;
friend class ButtonEventDataTransition;
};
#include "buttonEventDataAttribute.I"
#endif