AI Watch A1
Multi-person 3D skeleton detection using Intel RealSense and OpenPose with Kafka support.
Public Member Functions | Protected Member Functions | Private Attributes | List of all members
MoveCommand Class Reference

The MoveCommand class is a class that implements a command to move files through specific directories. More...

#include <SystemCommand.hpp>

Inheritance diagram for MoveCommand:
SystemCommand

Public Member Functions

void executeCommand (int *argc, char ***argv)
 This method is responsible for executing commands on the system based on the filled command string. If the string is empty, then no command is executed. More...
 

Protected Member Functions

void setCommand (int *argc, char ***argv) override
 Set the string command to moving files through the directories command. More...
 
void setCommand (std::string command)
 Set the string command with a particularly given string passed as a parameter. More...
 
std::string getCommand (void)
 Get the string command. More...
 

Private Attributes

std::string command
 The final command given to the system by the program. More...
 

Detailed Description

The MoveCommand class is a class that implements a command to move files through specific directories.

Definition at line 103 of file SystemCommand.hpp.

Member Function Documentation

◆ executeCommand()

void SystemCommand::executeCommand ( int *  argc,
char ***  argv 
)
inherited

This method is responsible for executing commands on the system based on the filled command string. If the string is empty, then no command is executed.

Parameters
argcpointer to argc from the main function or based on what the program reads from the configuration file.
argvpointer to argv from the main function or based on what the program reads from the configuration file.

Definition at line 23 of file SystemCommand.cpp.

23 {
24 setCommand(argc, argv);
25 if (getCommand().size() > 0 && getCommand() != "OP") std::system(getCommand().c_str());
26}
std::string getCommand(void)
Get the string command.
virtual void setCommand(int *argc, char ***argv)=0
Set the string command. The method is inherited from the subclasses and overridden in order to expres...

References SystemCommand::getCommand(), and SystemCommand::setCommand().

Referenced by FacadeSingleton::cleanBuildFolder(), and FacadeSingleton::getVideoBodyKeyPoints().

◆ getCommand()

std::string SystemCommand::getCommand ( void  )
protectedinherited

Get the string command.

Returns
std::string

Definition at line 19 of file SystemCommand.cpp.

19 {
20 return this->command;
21}
std::string command
The final command given to the system by the program.

References SystemCommand::command.

Referenced by SystemCommand::executeCommand().

◆ setCommand() [1/2]

void MoveCommand::setCommand ( int *  argc,
char ***  argv 
)
overrideprotectedvirtual

Set the string command to moving files through the directories command.

Parameters
argcpointer to argc based on what the program reads from the configuration file.
argvpointer to argv based on what the program reads from the configuration file.

Implements SystemCommand.

Definition at line 15 of file MoveCommand.cpp.

15 {
16 UsageManager * usageManagerInstance = UsageManager::getInstance();
17 if (usageManagerInstance == nullptr) CV_Error(USAGE_MANAGER_NULLPTR_ERROR, USAGE_MANAGER_NULLPTR_SCOPE);
18 char *** localArgv = usageManagerInstance->get_argv();
19 std::stringstream moveTerminalCommand;
20 const char * imagesFolder = (* localArgv)[imagesFolderOffset];
21 moveTerminalCommand << "mv -v " << imagesFolder << "rgb/ " << imagesFolder << "videoframe/ > /dev/null";
22 SystemCommand::setCommand(std::string(moveTerminalCommand.str()));
23}
UsageManager class is a utility class that helps with configuration parameters.
char *** get_argv(void)
Get the argv's pointer.
static UsageManager * getInstance(void)
Get the unique class instance. This methods should be called in the following scenario: when we just ...
static const short int imagesFolderOffset
Definition: constants.hpp:64
static const short int USAGE_MANAGER_NULLPTR_ERROR
Definition: constants.hpp:35
static const char * USAGE_MANAGER_NULLPTR_SCOPE
Definition: constants.hpp:36

References UsageManager::get_argv(), UsageManager::getInstance(), imagesFolderOffset, SystemCommand::setCommand(), USAGE_MANAGER_NULLPTR_ERROR, and USAGE_MANAGER_NULLPTR_SCOPE.

◆ setCommand() [2/2]

void SystemCommand::setCommand ( std::string  command)
protectedinherited

Set the string command with a particularly given string passed as a parameter.

Parameters
command

Definition at line 15 of file SystemCommand.cpp.

15 {
16 this->command = command;
17}

References SystemCommand::command.

Member Data Documentation

◆ command

std::string SystemCommand::command
privateinherited

The final command given to the system by the program.

Definition at line 33 of file SystemCommand.hpp.

Referenced by SystemCommand::getCommand(), and SystemCommand::setCommand().


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