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

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

#include <AddRole.h>

Public Member Functions

 AddRole (const std::string description)
 
 ~AddRole ()
 
CppSamples::Common::PluginRun (CppSamples::Common::DataModel *dataModel) override
 Adds a role 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 role to the current system.

Definition at line 12 of file AddRole.h.

Inherits CppSamples::Common::Plugin.

Constructor & Destructor Documentation

CppSamples::Roles::AddRole::AddRole ( const std::string  description)
inline

Definition at line 14 of file AddRole.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::Roles::AddRole::~AddRole ( )
inline

Definition at line 15 of file AddRole.h.

15 {}

Member Function Documentation

Plugin * CppSamples::Roles::AddRole::Run ( CppSamples::Common::DataModel dataModel)
overridevirtual

Adds a role to the current system.

Parameters
dataModelInstance of data model.

Implements CppSamples::Common::Plugin.

Definition at line 14 of file AddRole.cpp.

14  {
15 
16  // Read name from input
17  cout << "\n\n" << "Enter role name: ";
18  string name = Utility::ReadString();
19 
20  // Add Role
21  VxResult::Value result = dataModel->VxSystem->AddRole(name.c_str());
22  if (result == VxResult::kOK)
23  cout << "\n" << "Role added succesfully.\n";
24  else
25  cout << "\n" << "Failed to add role.\n";
26 
27  // Wait for user response before going back to parent menu.
28  Utility::Pause();
29 
30  // Return reference of parent plugin to move back to parent menu.
31  return GetParent();
32 }
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 AddRole(const char *roleName) const =0

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