C++ Samples
Demonstrates how to create a C++ application using the VideoXpert SDK
main.cpp File Reference
#include "stdafx.h"
#include "Controller.h"
#include "Common/MenuItem.h"
#include "Common/Controller.h"
#include "DataSource/ViewAllDataSource.h"
#include "DataSource/ViewDataSourceByPage.h"
#include "DataSource/ViewDataSourceDetails.h"
#include "LiveStreaming/DataSourceLiveStreaming.h"
#include "Exports/ViewExport.h"
#include "Exports/CreateExport.h"
#include "Exports/DeleteExport.h"
#include "Exports/DownloadExport.h"
#include "Reports/ViewQuickReport.h"
#include "Events/MonitorEvents.h"
#include "Events/SearchEvents.h"
#include "Events/DisplaySituations.h"
#include "Events/AddSituation.h"
#include "Events/DeleteSituation.h"
#include "Events/InjectEvents.h"
#include "Bookmarks/ViewAllBookmarks.h"
#include "Bookmarks/AddBookmark.h"
#include "Bookmarks/DeleteBookmark.h"
#include "Roles/ViewAllRoles.h"
#include "Roles/AddRole.h"
#include "Roles/DeleteRole.h"
#include "Notifications/ViewAllNotifications.h"
#include "Notifications/AddNotification.h"
#include "Notifications/DeleteNotification.h"
#include "Tags/ViewAllTags.h"
#include "Tags/AddTag.h"
#include "Tags/DeleteTag.h"
#include "Tags/MergeTag.h"
#include "Users/ViewAllUsers.h"
#include "Users/AddUser.h"
#include "Users/DeleteUser.h"
#include "Schedules/ViewAllSchedules.h"
#include "Schedules/AddSchedule.h"
#include "Schedules/AddTriggerToSchedule.h"
#include "Schedules/DeleteSchedule.h"
#include "Drawings/ViewAllDrawings.h"
#include "Drawings/AddDrawing.h"
#include "Drawings/DeleteDrawing.h"
#include "DataObjects/ViewAllDataObjects.h"
#include "DataObjects/AddDataObject.h"
#include "DataObjects/DeleteDataObject.h"
#include "Devices/ViewAllDevices.h"

Go to the source code of this file.

Functions

MenuItemCreateMenuStructure ()
 
int main ()
 
int _tmain ()
 
void AddSubMenu (MenuItem *menu, MenuItem *subMenu)
 

Function Documentation

int _tmain ( )

Definition at line 77 of file main.cpp.

77  {
78  // Create menu structure of the application.
79  MenuItem* rootMenu = CreateMenuStructure();
80  // Create new instance of Controller.
81  Controller controller(rootMenu);
82  // Start the controller
83  controller.Run();
84 
85  return 0;
86 }
MenuItem is a Plugin. It represents a menu.
Definition: MenuItem.h:12
Controller class handles the business logic of this application.
Definition: Controller.h:11
MenuItem * CreateMenuStructure()
Definition: main.cpp:98
void AddSubMenu ( MenuItem menu,
MenuItem subMenu 
)

Definition at line 89 of file main.cpp.

89  {
90  // Add default back menu at the end
91  subMenu->AddBackMenu();
92  // Add the given sub menu to the menu
93  menu->AddChild(subMenu);
94 }
void AddChild(Plugin *plugin)
The given plugin item will be added as submenu of this.
Definition: MenuItem.cpp:41
void AddBackMenu()
A default Back menu will be added as submenu of this.
Definition: MenuItem.cpp:36
MenuItem * CreateMenuStructure ( )

Definition at line 98 of file main.cpp.

98  {
99  // Create new instance of Root menu.
100  MenuItem* rootMenu = new MenuItem("Main Menu");
101 
102  // Data Sources
103  // ------------
104  MenuItem* dataSourceMenu = new MenuItem("DataSources");
105  dataSourceMenu->AddChild(new CppSamples::DataSource::ViewAllDataSource("View all DataSources"));
106  dataSourceMenu->AddChild(new CppSamples::DataSource::ViewDataSourceByPage("View DataSources page by page"));
107  dataSourceMenu->AddChild(new CppSamples::DataSource::ViewDataSourceDetails("View DataSource details"));
108  dataSourceMenu->AddChild(new CppSamples::LiveStreaming::DataSourceLiveStreaming("Live Streaming", false));
109  dataSourceMenu->AddChild(new CppSamples::LiveStreaming::DataSourceLiveStreaming("Playback", true));
110  AddSubMenu(rootMenu, dataSourceMenu);
111 
112  // Export
113  // ------
114  MenuItem* exportMenu = new MenuItem("Export");
115  exportMenu->AddChild(new CppSamples::Exports::ViewExport("View Exports"));
116  exportMenu->AddChild(new CppSamples::Exports::CreateExport("Create New Export"));
117  exportMenu->AddChild(new CppSamples::Exports::DeleteExport("Delete Export"));
118  exportMenu->AddChild(new CppSamples::Exports::DownloadExport("Download Export"));
119  exportMenu->AddChild(new CppSamples::Reports::ViewQuickReport("View Quick Report"));
120  AddSubMenu(rootMenu, exportMenu);
121 
122  // Events
123  // ------
124  MenuItem* eventsMenu = new MenuItem("Events");
125  eventsMenu->AddChild(new CppSamples::Events::MonitorEvents("Monitor Events"));
126  eventsMenu->AddChild(new CppSamples::Events::SearchEvents("Search Events"));
127  eventsMenu->AddChild(new CppSamples::Events::DisplaySituations("View Situations"));
128  eventsMenu->AddChild(new CppSamples::Events::AddSituation("Add New Situation"));
129  eventsMenu->AddChild(new CppSamples::Events::DeleteSituation("Delete Situation"));
130  eventsMenu->AddChild(new CppSamples::Events::InjectEvents("Inject Events"));
131  AddSubMenu(rootMenu, eventsMenu);
132 
133  // Bookmarks
134  // ---------
135  MenuItem* bookmarksMenu = new MenuItem("Bookmarks");
136  bookmarksMenu->AddChild(new CppSamples::Bookmarks::ViewAllBookmarks("View All Bookmarks"));
137  bookmarksMenu->AddChild(new CppSamples::Bookmarks::AddBookmark("Add Bookmark"));
138  bookmarksMenu->AddChild(new CppSamples::Bookmarks::DeleteBookmark("Delete Bookmark"));
139  AddSubMenu(rootMenu, bookmarksMenu);
140 
141  // Roles
142  // -----
143  MenuItem* rolesMenu = new MenuItem("Roles");
144  rolesMenu->AddChild(new CppSamples::Roles::ViewAllRoles("View All Roles"));
145  rolesMenu->AddChild(new CppSamples::Roles::AddRole("Add Role"));
146  rolesMenu->AddChild(new CppSamples::Roles::DeleteRole("Delete Role"));
147  AddSubMenu(rootMenu, rolesMenu);
148 
149  // Notifications
150  // -------------
151  MenuItem* notificationsMenu = new MenuItem("Notifications");
152  notificationsMenu->AddChild(new CppSamples::Notifications::ViewAllNotifications("View All Notifications"));
153  notificationsMenu->AddChild(new CppSamples::Notifications::AddNotification("Add Notification"));
154  notificationsMenu->AddChild(new CppSamples::Notifications::DeleteNotification("Delete Notification"));
155  AddSubMenu(rootMenu, notificationsMenu);
156 
157  // Tags
158  // ----
159  MenuItem* tagsMenu = new MenuItem("Tags");
160  tagsMenu->AddChild(new CppSamples::Tags::ViewAllTags("View All Tags"));
161  tagsMenu->AddChild(new CppSamples::Tags::AddTag("Add Tag"));
162  tagsMenu->AddChild(new CppSamples::Tags::DeleteTag("Delete Tag"));
163  tagsMenu->AddChild(new CppSamples::Tags::MergeTag("Merge Two Tags"));
164  AddSubMenu(rootMenu, tagsMenu);
165 
166  // Users
167  // -----
168  MenuItem* usersMenu = new MenuItem("Users");
169  usersMenu->AddChild(new CppSamples::Users::ViewAllUsers("View All Users"));
170  usersMenu->AddChild(new CppSamples::Users::AddUser("Add User"));
171  usersMenu->AddChild(new CppSamples::Users::DeleteUser("Delete User"));
172  AddSubMenu(rootMenu, usersMenu);
173 
174  // Schedules
175  // ---------
176  MenuItem* schedulesMenu = new MenuItem("Schedules");
177  schedulesMenu->AddChild(new CppSamples::Schedules::ViewAllSchedules("View All Schedules"));
178  schedulesMenu->AddChild(new CppSamples::Schedules::AddSchedule("Add Schedule"));
179  schedulesMenu->AddChild(new CppSamples::Schedules::AddTriggerToSchedule("Add Trigger to Schedule"));
180  schedulesMenu->AddChild(new CppSamples::Schedules::DeleteSchedule("Delete Schedule"));
181  AddSubMenu(rootMenu, schedulesMenu);
182 
183  // Drawings
184  // --------
185  MenuItem* drawingsMenu = new MenuItem("Drawings");
186  drawingsMenu->AddChild(new CppSamples::Drawings::ViewAllDrawings("View All Drawings"));
187  drawingsMenu->AddChild(new CppSamples::Drawings::AddDrawing("Add Drawing"));
188  drawingsMenu->AddChild(new CppSamples::Drawings::DeleteDrawing("Delete Drawing"));
189  AddSubMenu(rootMenu, drawingsMenu);
190 
191  // Data Objects
192  // ------------
193  MenuItem* dataObjectsMenu = new MenuItem("Data Objects");
194  dataObjectsMenu->AddChild(new CppSamples::DataObjects::ViewAllDataObjects("View All DataObjects"));
195  dataObjectsMenu->AddChild(new CppSamples::DataObjects::AddDataObject("Add DataObject"));
196  dataObjectsMenu->AddChild(new CppSamples::DataObjects::DeleteDataObject("Delete DataObject"));
197  AddSubMenu(rootMenu, dataObjectsMenu);
198 
199  // Devices
200  // -------
201  MenuItem* devicesMenu = new MenuItem("Devices");
202  devicesMenu->AddChild(new CppSamples::Devices::ViewAllDevices("View All Devices"));
203  AddSubMenu(rootMenu, devicesMenu);
204 
205  // Exit menu
206  rootMenu->AddExitMenu();
207  return rootMenu;
208 }
This plugin sample delete a selected bookmark from the current system.
This plugin sample adds a dataObject to the current system.
Definition: AddDataObject.h:12
This plugin sample shows how to subscribe for a notification, monitor for a call back and unsubscribe...
Definition: MonitorEvents.h:12
This plugin sample print all bookmarks available in the current system.
This plugin sample print all devices available in the current system.
This plugin sample delete a selected schedule from the current system.
void AddSubMenu(MenuItem *menu, MenuItem *subMenu)
Definition: main.cpp:89
This plugin sample adds a bookmark to the current system.
Definition: AddBookmark.h:12
This plugin sample delete a selected drawing from the current system.
Definition: DeleteDrawing.h:12
This plugin sample print all available data sources in the current system.
This plugin sample print all dataObjects available in the current system.
This plugin sample adds a tag to the current system.
Definition: AddTag.h:12
This plugin sample merge two tags in the current system.
Definition: MergeTag.h:12
This plugin sample adds a situation to the current system.
Definition: AddSituation.h:12
This plugin sample delete a selected tag from the current system.
Definition: DeleteTag.h:12
This plugin sample print all notifications available in the current system.
This plugin sample serachs for events in the current system. User defined filters are used for search...
Definition: SearchEvents.h:12
void AddChild(Plugin *plugin)
The given plugin item will be added as submenu of this.
Definition: MenuItem.cpp:41
This plugin sample print a quick report on screen.
This plugin sample print all users available in the current system.
Definition: ViewAllUsers.h:12
This plugin sample print all tags available in the current system.
Definition: ViewAllTags.h:12
This plugin sample creates an export and adds to the current system.
Definition: CreateExport.h:12
This plugin sample adds a drawing to the current system.
Definition: AddDrawing.h:12
This plugin sample adds a role to the current system.
Definition: AddRole.h:12
This plugin sample streams the video in live
This plugin sample deletes an export from the current system.
Definition: DeleteExport.h:12
This plugin sample adds a user to the current system.
Definition: AddUser.h:12
This plugin sample delete a selected role from the current system.
Definition: DeleteRole.h:12
This plugin sample creates a new event and insert it into the system.
Definition: InjectEvents.h:12
This plugin sample delete a selected notification from the current system.
This plugin sample print the details of a particular data source specified by user in the current sys...
MenuItem is a Plugin. It represents a menu.
Definition: MenuItem.h:12
This plugin sample delete a particular situation specified by user from the current system...
void AddExitMenu()
A default Exit menu will be added as submenu of this.
Definition: MenuItem.cpp:48
This plugin sample print all drawings available in the current system.
This plugin sample print all available situations in the current system.
This plugin sample delete a selected user from the current system.
Definition: DeleteUser.h:12
This plugin sample adds a notification to the current system.
This plugin sample delete a selected dataObject from the current system.
This plugin sample print all schedules available in the current system.
This plugin sample creates a trigger and add it to a selected schedule in the current system...
This plugin sample print all roles available in the current system.
Definition: ViewAllRoles.h:12
This plugin sample downloads an export from the current system and saves as a file.
This plugin sample adds a schedule to the current system.
Definition: AddSchedule.h:12
This plugin sample print all exports available in the current system.
Definition: ViewExport.h:12
This plugin sample print all available data sources in the current system page by page...
int main ( )

Definition at line 71 of file main.cpp.

71  {
72  return _tmain();
73 }
int _tmain()
Definition: main.cpp:77