NVIDIA DeepStream SDK API Reference

9.1 Release
9.1/service-maker/includes/signal_handler.hpp
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3  * SPDX-License-Identifier: Apache-2.0
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 
29 #ifndef NVIDIA_DEEPSTREAM_SIGNAL_HANDLER
30 #define NVIDIA_DEEPSTREAM_SIGNAL_HANDLER
31 
32 #include "custom_object.hpp"
33 
34 namespace deepstream {
35 
45 class SignalHandler : public CustomObject {
46 public:
47 
49  typedef struct {
51  std::string name;
53  void* fn;
54  } Callback;
55 
57  class IActionProvider {
58  public:
59  virtual ~IActionProvider() {}
60 
62  virtual const Callback* getCallbacks() = 0;
63  };
64 
73  SignalHandler(const std::string& name, IActionProvider* provider);
74 
84  SignalHandler(const std::string& name, const char* factory, IActionProvider* provider);
85 
87  virtual ~SignalHandler();
88 
90  static unsigned long type();
91 
93  void* getCallbackFn(const std::string& name) const;
94 
95 protected:
96  std::unique_ptr<IActionProvider> provider_;
97 };
98 
99 }
100 
101 
102 #endif
deepstream::SignalHandler::type
static unsigned long type()
Return the type id assigned to signal handler.
custom_object.hpp
deepstream::SignalHandler::IActionProvider::getCallbacks
virtual const Callback * getCallbacks()=0
return the callback
deepstream::SignalHandler::Callback
generic callback on the signal
Definition: service-maker/includes/signal_handler.hpp:49
deepstream
Definition: service-maker/includes/buffer.hpp:38
deepstream::SignalHandler::getCallbackFn
void * getCallbackFn(const std::string &name) const
Return the callback for a specific signal.
deepstream::SignalHandler::SignalHandler
SignalHandler(const std::string &name, IActionProvider *provider)
Constructor.
deepstream::SignalHandler::provider_
std::unique_ptr< IActionProvider > provider_
Definition: service-maker/includes/signal_handler.hpp:96
deepstream::SignalHandler::~SignalHandler
virtual ~SignalHandler()
Destructor.
deepstream::SignalHandler::IActionProvider::~IActionProvider
virtual ~IActionProvider()
Definition: 9.1/service-maker/includes/signal_handler.hpp:59