fbxqueryevent.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /****************************************************************************************
  2. Copyright (C) 2015 Autodesk, Inc.
  3. All rights reserved.
  4. Use of this software is subject to the terms of the Autodesk license agreement
  5. provided at the time of installation or download, or which otherwise accompanies
  6. this software in either electronic or hard copy form.
  7. ****************************************************************************************/
  8. //! \file fbxqueryevent.h
  9. #ifndef _FBXSDK_CORE_QUERY_EVENT_H_
  10. #define _FBXSDK_CORE_QUERY_EVENT_H_
  11. #include <fbxsdk/fbxsdk_def.h>
  12. #include <fbxsdk/core/fbxevent.h>
  13. #include <fbxsdk/fbxsdk_nsbegin.h>
  14. /** A query event is something that is emitted by an entity, with the goal of being filled by someone that listen to it.
  15. * You can see that like a form that you send to some people. If those people know how to fill the form, they fill it and return
  16. * it to you with the right information in it. A query event is emitted, and plug-in who are listening to that type of query,
  17. * fill the data that can be accessed by the query emitter.
  18. */
  19. template <typename QueryT> class FbxQueryEvent : public FbxEvent<FbxQueryEvent<QueryT> >
  20. {
  21. public:
  22. /**
  23. *\name Public interface
  24. */
  25. //@{
  26. /** Constructor.
  27. * \param pData The requested data.
  28. */
  29. explicit FbxQueryEvent(QueryT* pData):mData(pData){}
  30. /** Accessor to a mutable reference to the data. Event are usually const and can't be modified by listener.
  31. * This special type of event can have is content modified via this accessor.
  32. * \return A mutable reference the requested data.
  33. */
  34. QueryT& GetData()const { return *mData; }
  35. //@}
  36. private:
  37. mutable QueryT* mData;
  38. private:
  39. virtual const char* GetEventName() const { FBX_ASSERT(false); return ""; }
  40. static const char* FbxEventName() { FBX_ASSERT(false); return ""; }
  41. friend class FbxEvent< FbxQueryEvent<QueryT> >;
  42. };
  43. #include <fbxsdk/fbxsdk_nsend.h>
  44. #endif /* _FBXSDK_CORE_QUERY_EVENT_H_ */