| OrbbecSDK 1.5.7 OrbbecSDK: Software-Development-Kit for Orbbec 3D-Sensor devices

- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Types | Public Member Functions | Static Public Member Functions | List of all members
ob::Context Class Reference

`#include <Context.hpp>`

## Public Types
using | DeviceChangedCallback = std::function< void(std::shared_ptr< DeviceList > removedList, std::shared_ptr< DeviceList > addedList)>

## Public Member Functions
| Context (const char *configPath="")
| Context is a management class that describes the runtime of the SDK. It is responsible for the applying and releasing of resources for the SDK. The context has the ability to manage multiple devices, is responsible for enumerating devices, monitoring device callbacks, and enabling functions such as multi-device synchronization. More...
virtual | ~Context () noexcept
std::shared_ptr< DeviceList > | queryDeviceList ()
| Query enumerated device list. More...
std::shared_ptr< Device > | createNetDevice (const char *address, uint16_t port)
| 创建网络设备对象 More...
void | setDeviceChangedCallback (DeviceChangedCallback callback)
| Set device plug-in callback function. More...
void | enableMultiDeviceSync (uint64_t repeatInterval)
| Activate the multi-device synchronization function to synchronize the clock of the created device(the device needs support this function) More...

## Static Public Member Functions
static void | setLoggerSeverity (OBLogSeverity severity)
| Set the level of the global log will affect both the log level output to the terminal and output to the file. More...
static void | setLoggerToFile (OBLogSeverity severity, const char *directory)
| Set log output to file. More...
static void | setLoggerToConsole (OBLogSeverity severity)
| Set log output to terminal. More...

## Detailed Description

Definition at line 25 of file Context.hpp.

## Member Typedef Documentation

using ob::Context::DeviceChangedCallback = std::function<void(std::shared_ptr<DeviceList> removedList, std::shared_ptr<DeviceList> addedList)>

Definition at line 65 of file Context.hpp.

## Constructor & Destructor Documentation

ob::Context::Context | ( | const char * | configPath = `""` | ) |

Context is a management class that describes the runtime of the SDK. It is responsible for the applying and releasing of resources for the SDK. The context has the ability to manage multiple devices, is responsible for enumerating devices, monitoring device callbacks, and enabling functions such as multi-device synchronization.

virtual ob::Context::~Context | ( |  | ) |
| virtual noexcept

## Member Function Documentation

std::shared_ptr<DeviceList> ob::Context::queryDeviceList | ( |  | ) |

Query enumerated device list.

Returns
  std::shared_ptr<DeviceList> returns a pointer to the device list class

std::shared_ptr<Device> ob::Context::createNetDevice | ( | const char * | address,
|  | uint16_t | port
| ) |  |

创建网络设备对象

Parameters

  address | ip 地址
  port | 端口号

Returns
  std::shared_ptr<Device> 返回创建好的设备对象

void ob::Context::setDeviceChangedCallback | ( | DeviceChangedCallback | callback | ) |

Set device plug-in callback function.

Parameters

  callback | function triggered when the device is plugged and unplugged

void ob::Context::enableMultiDeviceSync | ( | uint64_t | repeatInterval | ) |

Activate the multi-device synchronization function to synchronize the clock of the created device(the device needs support this function)

Parameters

  repeatInterval | synchronization time interval (unit: ms; if repeatInterval=0, it means that it will only be synchronized once and will not be executed regularly)

static void ob::Context::setLoggerSeverity | ( | OBLogSeverity | severity | ) |
| static

Set the level of the global log will affect both the log level output to the terminal and output to the file.

Parameters

  severity | log output level

static void ob::Context::setLoggerToFile | ( | OBLogSeverity | severity,
|  | const char * | directory
| ) |  |
| static

Set log output to file.

Parameters

  severity | log level output to file
  directory | The log file output path. If the path is empty, the existing settings will continue to be used (if the existing configuration is also empty, the log will not be output to the file)

static void ob::Context::setLoggerToConsole | ( | OBLogSeverity | severity | ) |
| static

Set log output to terminal.

Parameters

  severity | log level output to the terminal

The documentation for this class was generated from the following file:

- /root/libobsensor/include/libobsensor/hpp/Context.hpp