C++ Samples
Demonstrates how to create a C++ application using the VideoXpert SDK
CppSamples::DataObjects::AddDataObject Class Reference

This plugin sample adds a dataObject to the current system. More...

#include <AddDataObject.h>

Public Member Functions

 AddDataObject (const std::string description)
 
 ~AddDataObject ()
 
CppSamples::Common::PluginRun (CppSamples::Common::DataModel *dataModel) override
 Adds a dataObject to the current system. More...
 
- Public Member Functions inherited from CppSamples::Common::Plugin
 Plugin (const std::string description)
 
virtual ~Plugin ()
 
std::string GetDescription () const
 Gets the description of this plugin. More...
 
PluginGetParent () const
 Gets the reference to the parent of this plugin. More...
 
void SetParent (Plugin *parent)
 Sets the reference to the parent of this plugin. More...
 

Detailed Description

This plugin sample adds a dataObject to the current system.

Definition at line 12 of file AddDataObject.h.

Inherits CppSamples::Common::Plugin.

Constructor & Destructor Documentation

CppSamples::DataObjects::AddDataObject::AddDataObject ( const std::string  description)
inline

Definition at line 14 of file AddDataObject.h.

14 : CppSamples::Common::Plugin(description) { }
Plugin is the abstract class which can be a menu item and/or a sample. Every sample and menu item mus...
Definition: Plugin.h:33
CppSamples::DataObjects::AddDataObject::~AddDataObject ( )
inline

Definition at line 15 of file AddDataObject.h.

15 {}

Member Function Documentation

Plugin * CppSamples::DataObjects::AddDataObject::Run ( CppSamples::Common::DataModel dataModel)
overridevirtual

Adds a dataObject to the current system.

Parameters
dataModelInstance of data model.

Implements CppSamples::Common::Plugin.

Definition at line 14 of file AddDataObject.cpp.

14  {
15  // Read clientType from input
16  cout << "\n\n" << "Enter dataObject client type: ";
17  string clientType = Utility::ReadString();
18 
19  // Read data from input
20  cout << "\n\n" << "Enter data: ";
21  string data = Utility::ReadString();
22 
23  // Add DataObject
24  VxNewDataObject dataObject;
25  dataObject.data = new char[data.size()+1]();
26  Utilities::StrCopySafe(dataObject.clientType, clientType.c_str(), clientType.size()+1);
27  Utilities::StrCopySafe(dataObject.data, data.c_str(), data.size()+1);
28 
29  // Make the call to add the dataObject into VideoXpert
30  VxResult::Value result = dataModel->VxSystem->AddDataObject(dataObject);
31  if (result == VxResult::kOK)
32  cout << "\n" << "DataObject added succesfully.\n";
33  else
34  cout << "\n" << "Failed to add dataObject.\n";
35 
36  // Wait for user response before going back to parent menu.
37  Utility::Pause();
38 
39  // Return reference of parent plugin to move back to parent menu.
40  return GetParent();
41 }
VxSdk::IVxSystem * VxSystem
Represents a VideoXpert system and allows the user to manage the system and devices.
Definition: Plugin.h:17
Plugin * GetParent() const
Gets the reference to the parent of this plugin.
Definition: Plugin.h:46
virtual VxResult::Value AddDataObject(VxNewDataObject &newDataObject) const =0

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