Viam C++ SDK current
Loading...
Searching...
No Matches
Classes | Public Types | Static Public Member Functions | Friends | List of all members
viam::sdk::Instance Class Reference

Instance management for Viam C++ SDK applications. This is a single instance class which is responsible for global setup and teardown related to the SDK. An Instance must be constructed before doing anything else in a program, and it must remain alive in a valid state for the duration of the program. Creating multiple Instance objects in the same program is an error. More...

#include <instance.hpp>

Classes

struct  Impl
 

Public Types

enum class  Creation { open_existing , if_needed }
 Enumeration for creation behavior of current. More...
 

Static Public Member Functions

static Instancecurrent (Creation)
 Get the current Instance according to the Creation behavior.
 

Friends

class Registry
 

Detailed Description

Instance management for Viam C++ SDK applications. This is a single instance class which is responsible for global setup and teardown related to the SDK. An Instance must be constructed before doing anything else in a program, and it must remain alive in a valid state for the duration of the program. Creating multiple Instance objects in the same program is an error.

Member Enumeration Documentation

◆ Creation

enum class viam::sdk::Instance::Creation
strong

Enumeration for creation behavior of current.

Enumerator
open_existing 

Instance must already exist.

if_needed 

Use existing instance if present, else create one.

Member Function Documentation

◆ current()

static Instance & viam::sdk::Instance::current ( Creation )
static

Get the current Instance according to the Creation behavior.

Exceptions
anClasses related to SDK exceptions. if current(Creation::open_existing) is called when an instance has not yet been constructed.

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