NAP
oscservice.h
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2  * License, v. 2.0. If a copy of the MPL was not distributed with this
3  * file, You can obtain one at https://mozilla.org/MPL/2.0/. */
4 
5 #pragma once
6 
7 // Local Includes
8 #include "oscevent.h"
9 
10 // External Includes
11 #include <nap/service.h>
12 #include <entity.h>
13 #include <nap/datetime.h>
14 
15 namespace nap
16 {
17  class OSCReceiver;
18  class OSCInputComponentInstance;
19 
28  class NAPAPI OSCService : public Service
29  {
30  friend class OSCReceiver;
32  RTTI_ENABLE(Service)
33  public:
34  // Default Constructor
35  OSCService(ServiceConfiguration* configuration);
36 
37  // Default Destructor
38  virtual ~OSCService();
39 
40  protected:
45  virtual void registerObjectCreators(rtti::Factory& factory) override;
46 
50  virtual bool init(nap::utility::ErrorState& errorState) override;
51 
58  virtual void update(double deltaTime) override;
59 
60  private:
64  void registerReceiver(OSCReceiver& receiver);
65 
69  void removeReceiver(OSCReceiver& receiver);
70 
74  void registerInputComponent(OSCInputComponentInstance& input);
75 
79  void removeInputComponent(OSCInputComponentInstance& input);
80 
81  // All the osc receivers currently registered in the system
82  std::vector<OSCReceiver*> mReceivers;
83 
84  // All the osc components currently available to the system
85  std::vector<OSCInputComponentInstance*> mInputs;
86  };
87 }
nap::utility::ErrorState
Definition: errorstate.h:19
nap::OSCInputComponentInstance
Definition: oscinputcomponent.h:46
nap::ServiceConfiguration
Definition: service.h:28
nap::Service
Definition: templateservice.h:8
nap::rtti::Factory
Definition: factory.h:78
nap::OSCReceiver
Definition: oscreceiver.h:34
nap
Definition: templateapp.h:17
nap::OSCService
Definition: oscservice.h:28