libnifalcon  1.0.1
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | List of all members
libnifalcon::FalconCLIBase Class Reference

#include <FalconCLIBase.h>

+ Collaboration diagram for libnifalcon::FalconCLIBase:

Public Types

enum  { DEVICE_OPTIONS = 0x1, COMM_OPTIONS = 0x2, FIRMWARE_OPTIONS = 0x4 }
 

Public Member Functions

 FalconCLIBase ()
 
virtual ~FalconCLIBase ()
 

Protected Member Functions

virtual void addOptions (int value)
 
virtual bool parseOptions (int argc, char **argv)
 
void outputProgramOptions ()
 
bool calibrateDevice ()
 

Protected Attributes

std::unique_ptr< FalconDevicem_falconDevice
 
optparse::OptionParser m_parser
 
bool m_displayCalibrationMessage
 

Private Member Functions

 DECLARE_LOGGER ()
 

Detailed Description

FalconCLIBase provides an simple framework for building test applications with libnifalcon. It wraps the information needed from the user into a set of cpp-optparse options, and does the work of parsing command line options for:

See the falcon_test_cli program for an example of a test suite program built using FalconCLIBase

Member Enumeration Documentation

anonymous enum

Enumeration of options that this class provides

Enumerator
DEVICE_OPTIONS 

Allows user to choose device index, see device count, etc...

COMM_OPTIONS 

Allows user to choose communications type. Not commonly used since comm is usually set by default in FalconDevice now (see FalconDevice constructor).

FIRMWARE_OPTIONS 

Allows user to choose firmware type, load firmware, etc...

Constructor & Destructor Documentation

libnifalcon::FalconCLIBase::FalconCLIBase ( )

Constructor

virtual libnifalcon::FalconCLIBase::~FalconCLIBase ( )
inlinevirtual

Destructor

Member Function Documentation

void libnifalcon::FalconCLIBase::addOptions ( int  value)
protectedvirtual

Builds options map. Overridden to add application specific options

bool libnifalcon::FalconCLIBase::calibrateDevice ( )
protected

Conveinence function for handling device calibration

libnifalcon::FalconCLIBase::DECLARE_LOGGER ( )
private
void libnifalcon::FalconCLIBase::outputProgramOptions ( )
protected

Prints help message

bool libnifalcon::FalconCLIBase::parseOptions ( int  argc,
char **  argv 
)
protectedvirtual

Parses options off command line. Overridden to handle application specific options

Returns
True if command line options are parsed correctly, false otherwise

Member Data Documentation

bool libnifalcon::FalconCLIBase::m_displayCalibrationMessage
protected

String to display with calibration instructions

std::unique_ptr<FalconDevice> libnifalcon::FalconCLIBase::m_falconDevice
protected

Internal device structure

optparse::OptionParser libnifalcon::FalconCLIBase::m_parser
protected

Structure of options that we'll allow


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