MAK Legion 1.1 API Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
controlManager.h
Go to the documentation of this file.
1 /*********************************************************************************
2 ** Copyright (c) 2020 MAK Technologies, Inc.
3 ** All rights reserved.
4 *********************************************************************************/
5 
8 
9 #pragma once
10 
11 #include "legionDataStore/export.h"
16 
17 #include <string>
18 #include <vector>
19 #include <functional>
20 
21 
22 namespace Legion
23 {
25 
27 
33  class LEGION_DLL ControlManager
34  {
35  public:
37  template<typename CONTROL_TYPE>
38  CONTROL_TYPE createControl();
39 
40  virtual ControlManagerHandle handle() const;
41 
43  virtual UInt32 addControl(const ControlInstance& iControl);
44 
46  virtual ControlId registerControl(const ControlDescriptor& reg);
47 
49  virtual ParameterId parameterId(ControlId controlId, const std::string& parameterName);
50 
54  template<typename CONTROL_TYPE>
55  UInt32 addControlCallback(Callback<void(Span<CONTROL_TYPE>&)> cb);
56 
57 
60  template<typename CONTROL_TYPE>
61  bool removeControlCallback(UInt32 handle);
62 
63 
65  template<typename CONTROL_TYPE>
66  const std::vector<CONTROL_TYPE> getControls();
67 
68 
70  template<typename CONTROL_TYPE>
71  const std::vector<CONTROL_TYPE> peekControls();
72 
73  virtual void addInterest(const ControlId controlId);
74  virtual void removeInterest(const ControlId controlId);
75 
76  protected:
79 
81  virtual ~ControlManager();
82  friend class SimulationDatabase;
83 
84  struct CallbackData
85  {
87  std::function<void(ControlHandle* controls, UInt32 count)> convertAndExecute;
88  };
89 
90  static void callback(void* usr, ControlHandle* controls, UInt32 count);
92  std::vector<CallbackData*> myCallbackData;
93 
95  };
96 }
97 
UInt32 myNextCallbackHandle
Definition: controlManager.h:91
UInt64 ControlHandle
Definition: controlInstance.h:24
std::vector< CallbackData * > myCallbackData
Definition: controlManager.h:92
std::function< void(ControlHandle *controls, UInt32 count)> convertAndExecute
Definition: controlManager.h:87
Defines a template callback object to make binding member function pointers easier.
A span represents a contiguous array of objects in memory.
Definition: span.h:22
Callback template for binding static or member functions for callback at later time The return type a...
Definition: callback.h:66
UInt32 ControlId
Definition: controlInstance.h:22
UInt64 ControlManagerHandle
Definition: controlManager.h:24
ControlManagerHandle myHandle
Definition: controlManager.h:94
unsigned int UInt32
Definition: dataTypes.h:44
The SimulationDatabase stores all data for the simulation. It also owns the event, control, and view managers.
Definition: simulationDatabase.h:42
Definition: controlManager.h:84
A control descriptor describes the layout of a control.
Definition: eventDescriptor.h:35
unsigned long long UInt64
Definition: dataTypes.h:46
UInt32 ParameterId
Definition: controlInstance.h:23
The control manager is responsible for creating and adding controls to the simulation database...
Definition: controlManager.h:33
The control instance is an instance of a control.
Definition: controlInstance.h:32
UInt32 handle
Definition: controlManager.h:86

Document ID: Generated on Wed May 26 15:17:05 EDT 2021 from SVN revision 229676
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)