/* * -------------------------------------------------------------------------------------------- * * VVV VVV A * VVV VVV AAA Virtual Acoustics (VA) * VVV VVV AAA Real-time auralisation for virtual reality * VVV VVV AAA * VVVVVV AAA (c) Copyright Institute of Technical Acoustics (ITA) * VVVV AAA RWTH Aachen University (http://www.akustik.rwth-aachen.de) * * -------------------------------------------------------------------------------------------- */ #ifndef VA_INCLUDE_GUARD_VAOBJECT #define VA_INCLUDE_GUARD_VAOBJECT #include #include // Forward declarations class VABASE_API CVAStruct; //! Base class for objects with identity and message interface /** * In VA, anything can be an object and can be called via the module call interface during runtime. * These calls are usually not thread-safe. */ class VABASE_API CVAObject { public: //! Default constructor CVAObject(); //! Initialization constructors CVAObject( const char* pszName ); CVAObject( const std::string& sName ); //! Destructor virtual ~CVAObject(); //! Returns the ID of the object int GetObjectID() const; //! Returns the name of the object std::string GetObjectName() const; //! Returns information on the object virtual CVAObjectInfo GetObjectInfo() const; //! Call the object with a message and capture return message /** * \return >0, if the object returned an answer message * 0, if the object did not return an answer message * -1, if the message could not be handled */ // TODO: Int als Rückgabe? virtual int CallObject( const CVAStruct& oArgs, CVAStruct& oReturn ); protected: // Important: An object may not change its name after it is registered void SetObjectName( const std::string& sName ); private: int m_iObjectID; std::string m_sObjectName; // Note: This may only be called from an object registry void SetObjectID( int iID ); friend class CVAObjectRegistry; }; #endif // VA_INCLUDE_GUARD_VAOBJECT