ifw-ccf 5.0.2
Loading...
Searching...
No Matches
Classes | Namespaces | Macros | Functions | Variables
base.hpp File Reference
#include <execinfo.h>
#include <iostream>
#include <cstdlib>
#include <cxxabi.h>
#include <fmt/format.h>
#include <boost/exception/diagnostic_information.hpp>
#include <config-ng/ciiConfigApi.hpp>
#include <Recif.hpp>
#include <ifw/fnd/defs/dataType.hpp>
#include <ifw/core/utils/base/base.hpp>
#include <ifw/core/utils/system/system.hpp>
#include <ifw/core/utils/time/time.hpp>
#include <ifw/core/utils/conversion/conversion.hpp>
#include <ifw/core/utils/bat/config.hpp>
#include <ifw/ccf/mptk/manager.hpp>

Go to the source code of this file.

Classes

class  ifw::ccf::Base
 Class to be used as parent all CCF classes. More...
 

Namespaces

namespace  ifw
 
namespace  ifw::ccf
 

Macros

#define CCFTIME   ifw::core::utils::time::Time()
 
#define CCFDEBUG(msg)
 
#define CCFTHROW(msg)   throw rad::Exception(IFWLOC + ": " + msg)
 

Functions

void ifw::ccf::SetApplicationLogName (const std::string &app_name)
 
log4cplus::Logger & ifw::ccf::Logger ()
 
log4cplus::Logger & ifw::ccf::FastLogger ()
 

Variables

std::string ifw::ccf::ccf_application_name
 
constexpr auto ifw::ccf::CCF_VERSION = "1.2.0"
 Version of CCF.
 
constexpr auto ifw::ccf::IFW_VERSION = "4.0"
 Version of IFW.
 
constexpr auto ifw::ccf::NO_VALUE = "__NO__VALUE__"
 
Standard metadata keywords.
constexpr auto ifw::ccf::META_KEY_EXPO_RATE = "MetaExpoType"
 
constexpr auto ifw::ccf::META_KEY_EXPO_TIME = "MetaExpoTime"
 
constexpr auto ifw::ccf::META_KEY_EXPO_WIN_BINX = "MetaExpoWinBinX"
 
constexpr auto ifw::ccf::META_KEY_EXPO_WIN_BINY = "MetaExpoWinBinY"
 
constexpr auto ifw::ccf::META_KEY_EXPO_WIN_STARTX = "MetaExpoWinStartX"
 
constexpr auto ifw::ccf::META_KEY_EXPO_WIN_STARTY = "MetaExpoWinStartY"
 
constexpr auto ifw::ccf::META_KEY_SYSTEM = "MetaSystem"
 
constexpr auto ifw::ccf::META_KEY_CAM_NAME = "MetaCamName"
 
constexpr auto ifw::ccf::META_KEY_CAM_ID = "MetaCamId"
 
constexpr auto ifw::ccf::META_KEY_CAM_MODEL = "MetaCamModel"
 
constexpr auto ifw::ccf::META_KEY_CAM_CHIPMODEL = "MetaCamChipModel"
 
constexpr auto ifw::ccf::META_KEY_CAM_TYPE = "MetaCamType"
 
Configuration parameter names.
constexpr auto ifw::ccf::CFG_NODE_ACQUISITION = "acquisition"
 
constexpr auto ifw::ccf::CFG_NODE_MONITORING = "monitoring"
 
constexpr auto ifw::ccf::CFG_NODE_TELEMETRY = "telemetry"
 
constexpr auto ifw::ccf::CFG_NODE_PROCESSING = "processing"
 
constexpr auto ifw::ccf::CFG_NODE_RECORDING = "recording"
 
constexpr auto ifw::ccf::CFG_NODE_SERVER = "server"
 
constexpr auto ifw::ccf::CFG_NODE_TASKS = "tasks"
 
constexpr auto ifw::ccf::CFG_KEY_ADAPTER = "adapter"
 
constexpr auto ifw::ccf::CFG_KEY_ADDRESS = "address"
 
constexpr auto ifw::ccf::CFG_KEY_AUTO_ADJUST_TIME_RATE = "auto_adjust_time_rate"
 
constexpr auto ifw::ccf::CFG_KEY_ALLOW_FRAME_SKIPPING = "allow_frame_skipping"
 
constexpr auto ifw::ccf::CFG_KEY_ALLOW_LOST_FRAMES = "allow_lost_frames"
 
constexpr auto ifw::ccf::CFG_KEY_AUTO_STOP_ACQ_AFTER_REC = "auto_stop_acq_after_rec"
 
constexpr auto ifw::ccf::CFG_KEY_ENABLED = "enabled"
 
constexpr auto ifw::ccf::CFG_KEY_DEVICES = "devices"
 
constexpr auto ifw::ccf::CFG_KEY_HEIGHT = "height"
 
constexpr auto ifw::ccf::CFG_KEY_ID = "id"
 
constexpr auto ifw::ccf::CFG_KEY_INIT_SETUP = "init_setup"
 
constexpr auto ifw::ccf::CFG_KEY_INPUT_QUEUE_SIZE = "input_queue_size"
 
constexpr auto ifw::ccf::CFG_KEY_MANUFACTURER = "manufacturer"
 
constexpr auto ifw::ccf::CFG_KEY_MAPPING = "mapping"
 
constexpr auto ifw::ccf::CFG_KEY_MAX_RATE = "max_rate"
 
constexpr auto ifw::ccf::CFG_KEY_MAX_RESOLUTION = "max_resolution"
 
constexpr auto ifw::ccf::CFG_KEY_METADATA_MAP = "metadata_map"
 
constexpr auto ifw::ccf::CFG_KEY_METADATA_KEY = "metadata_key"
 
constexpr auto ifw::ccf::CFG_KEY_MODEL = "model"
 
constexpr auto ifw::ccf::CFG_KEY_NAME = "name"
 
constexpr auto ifw::ccf::CFG_KEY_NAMES = "names"
 
constexpr auto ifw::ccf::CFG_KEY_NB_OF_SAMPLES = "nb_of_samples"
 
constexpr auto ifw::ccf::CFG_KEY_OLDB_NODE = "oldb_node"
 
constexpr auto ifw::ccf::CFG_KEY_OUPUT_QUEUE_SIZE = "output_queue_size"
 
constexpr auto ifw::ccf::CFG_KEY_PERIOD = "period"
 
constexpr auto ifw::ccf::CFG_KEY_PIPELINE = "pipeline"
 
constexpr auto ifw::ccf::CFG_KEY_PROPERTIES = "properties"
 
constexpr auto ifw::ccf::CFG_KEY_PROTOCOL = "protocol"
 
constexpr auto ifw::ccf::CFG_KEY_PUBLISHERS = "publishers"
 
constexpr auto ifw::ccf::CFG_KEY_RECIPES = "recipes"
 
constexpr auto ifw::ccf::CFG_KEY_REC_HIST_EXP = "rec_hist_expiration"
 
constexpr auto ifw::ccf::CFG_KEY_REC_HIST_SIZE = "rec_hist_size"
 
constexpr auto ifw::ccf::CFG_KEY_RESOLUTION = "resolution"
 
constexpr auto ifw::ccf::CFG_KEY_SDK = "sdk"
 
constexpr auto ifw::ccf::CFG_KEY_SIMULATION = "simulation"
 
constexpr auto ifw::ccf::CFG_KEY_SIM_ADDRESS = "sim_address"
 
constexpr auto ifw::ccf::CFG_KEY_TYPE = "type"
 
constexpr auto ifw::ccf::CFG_KEY_VALUE = "value"
 
constexpr auto ifw::ccf::CFG_KEY_WIDTH = "width"
 
constexpr auto ifw::ccf::CFG_KEY_WRITE_ON_INIT = "write_on_init"
 
Setup parameter names.
constexpr auto ifw::ccf::SETUP_NODE_EXPO = "expo"
 
constexpr auto ifw::ccf::SETUP_NODE_SIM = "sim"
 
constexpr auto ifw::ccf::SETUP_KEY_ADDRESS = "address"
 
constexpr auto ifw::ccf::SETUP_KEY_BASENAME = "basename"
 
constexpr auto ifw::ccf::SETUP_KEY_BIN_X = "bin_x"
 
constexpr auto ifw::ccf::SETUP_KEY_BIN_Y = "bin_y"
 
constexpr auto ifw::ccf::SETUP_KEY_DELAY = "delay"
 
constexpr auto ifw::ccf::SETUP_KEY_ENABLED = "enabled"
 
constexpr auto ifw::ccf::SETUP_KEY_FILE = "file"
 
constexpr auto ifw::ccf::SETUP_KEY_FORMAT = "format"
 
constexpr auto ifw::ccf::SETUP_KEY_FRAME_RATE = "frame_rate"
 
constexpr auto ifw::ccf::SETUP_KEY_FRAME_RATE_LIMIT = "frame_rate_limit"
 
constexpr auto ifw::ccf::SETUP_KEY_INTERFACE = "interface"
 
constexpr auto ifw::ccf::SETUP_KEY_MAX_RATE = "max_rate"
 
constexpr auto ifw::ccf::SETUP_KEY_MAX_SHIFT = "max_shift"
 
constexpr auto ifw::ccf::SETUP_KEY_MAX_SHIFT_PR_FRAME = "max_shift_pr_frame"
 
constexpr auto ifw::ccf::SETUP_KEY_MAX_SIZE = "max_size"
 
constexpr auto ifw::ccf::SETUP_KEY_MODE = "mode"
 
constexpr auto ifw::ccf::SETUP_KEY_NB = "nb"
 
constexpr auto ifw::ccf::SETUP_KEY_RATE = "rate"
 
constexpr auto ifw::ccf::SETUP_KEY_NOISE = "noise"
 
constexpr auto ifw::ccf::SETUP_KEY_PORT = "port"
 
constexpr auto ifw::ccf::SETUP_KEY_TIME = "time"
 
constexpr auto ifw::ccf::SETUP_KEY_TYPE = "type"
 
constexpr auto ifw::ccf::SETUP_KEY_WIN_START_X = "win_start_x"
 
constexpr auto ifw::ccf::SETUP_KEY_WIN_START_Y = "win_start_y"
 
constexpr auto ifw::ccf::SETUP_KEY_WIN_WIDTH = "win_width"
 
constexpr auto ifw::ccf::SETUP_KEY_WIN_HEIGHT = "win_height"
 
Simulation type.
constexpr auto ifw::ccf::SIM_TYPE_FILE_STR = "File"
 
constexpr auto ifw::ccf::SIM_TYPE_PATTERN1_STR = "Pattern1"
 

States (composite).

enum class  ifw::ccf::ThreadType {
  ifw::ccf::MONITOR = 1 , ifw::ccf::ACQUISITION , ifw::ccf::PROCESSING , ifw::ccf::PUBLISHER ,
  ifw::ccf::UNDEFINED = -1
}
 
enum class  ifw::ccf::HwStatus { ifw::ccf::NOT_OK = 0 , ifw::ccf::OK }
 HW status values. More...
 
enum class  ifw::ccf::Status { ifw::ccf::FAILURE = 0 , ifw::ccf::SUCCESS = 1 }
 General status variable. More...
 
constexpr auto ifw::ccf::STATE_ON_NOT_OP_NOT_READY = "On::NotOperational::NotReady"
 
constexpr auto ifw::ccf::STATE_ON_NOT_OP_READY = "On::NotOperational::Ready"
 
constexpr auto ifw::ccf::STATE_ON_OP_IDLE = "On::Operational::Idle"
 
constexpr auto ifw::ccf::STATE_ON_OP_ACQ = "On::Operational::Acquisition"
 
constexpr auto ifw::ccf::STATE_ON_OP_ACQ_NOT_REC = "On::Operational::Acquisition::NotRecording"
 
constexpr auto ifw::ccf::STATE_ON_OP_ACQ_REC = "On::Operational::Acquisition::Recording"
 
void ifw::ccf::SendThrMsg (const std::string &command, const std::string &sender_thread_name, const std::string &receiver_thread_name, const std::string &data)
 Send MPTK message via internal Message Bus.
 
bool ifw::ccf::ReceiveThrMsg (const std::string &receiver_thread_name, const double time_out, ifw::ccf::mptk::Message &message)
 Receive a message from the given thread. Returns true if message received.
 
void ifw::ccf::DecomposeSmStatus (const std::string &sm_state, std::string &sum_state, std::string &sum_substate)
 
void ifw::ccf::AssertPtr (const void *ptr, const std::string &object, const std::string &location)
 Check that pointer is not nullptr and raise rad::exception in case it is.
 

Execution status.

enum class  ifw::ccf::PubType { ifw::ccf::UNDEFINED = -1 , ifw::ccf::RECORDING = 1 , ifw::ccf::NOT_RECORDING }
 A Publisher may be Recording or Not-Recording. A Recording Publisher publishes data into files. More...
 
enum class  ifw::ccf::PubStatus {
  ifw::ccf::ACTIVE = recif::RecStatusNames::Active , ifw::ccf::COMPLETED = recif::RecStatusNames::Completed , ifw::ccf::STOPPED = recif::RecStatusNames::Stopped , ifw::ccf::ABORTED = recif::RecStatusNames::Aborted ,
  ifw::ccf::FAILED = recif::RecStatusNames::Failed , ifw::ccf::UNDEFINED = recif::RecStatusNames::Undefined
}
 Defines the various possible states of a Data Publisher. More...
 
enum class  ifw::ccf::ProcStatus {
  ifw::ccf::UNDEFINED = -1 , ifw::ccf::IDLE = 1 , ifw::ccf::PROCESSING = 32 , ifw::ccf::FINISHED = 128 ,
  ifw::ccf::FAILED = 256
}
 Possible states for a Processing Recipe defined. More...
 
enum class  ifw::ccf::ExpoMode { ifw::ccf::FINITE = 1 , ifw::ccf::CONTINUOUS , ifw::ccf::INACTIVE }
 Exposure modes. More...
 
constexpr auto ifw::ccf::SUCCESS = "Success"
 
constexpr auto ifw::ccf::FAILURE = "Failure"
 
std::string ifw::ccf::StatusToStr (ifw::ccf::Status status)
 Convert the status from number to string.
 
void ifw::ccf::ResetRecStatusObj (std::shared_ptr< recif::RecStatus > &rec_status_obj, const recif::RecStatusNames rec_status=recif::RecStatusNames::Undefined)
 Reset the members of the Recording Status Object.
 
void ifw::ccf::CopyRecStatusObj (const std::shared_ptr< recif::RecStatus > &src_rec_status_obj, const std::shared_ptr< recif::RecStatus > &trg_rec_status_obj)
 Cope the members of one Recording Status Object to another.
 

Exposure modes.

enum class  ifw::ccf::SimType { ifw::ccf::FILE = 1 , ifw::ccf::PATTERN1 }
 Simulation type. More...
 
constexpr auto ifw::ccf::EXPO_MODE_FINITE = "Finite"
 
constexpr auto ifw::ccf::EXPO_MODE_CONTINUOUS = "Continuous"
 
constexpr auto ifw::ccf::EXPO_MODE_INACTIVE = "Inactive"
 
constexpr auto ifw::ccf::REC_ID_PREFIX = "RecId"
 
ExpoMode ifw::ccf::ExpoModeToNb (const std::string &expo_mode)
 Convert exposure mode from number representation to string.
 

DB state nodes names.

const std::string ifw::ccf::DB_DELIM = std::string(ifw::core::utils::bat::CONFIG_DB_DELIMITER)
 
const std::string ifw::ccf::DB_NODE_SM_STATUS_STATE
 
const std::string ifw::ccf::DB_NODE_SM_STATUS_SUBSTATE
 
const std::string ifw::ccf::DB_NODE_SM_STATE
 
void ifw::ccf::PrintStackTrace ()
 
ifw::fnd::datatype::DataType ifw::ccf::CiiCfgNodeToIfwDataType (elt::configng::CiiConfigInstanceNode &node)
 Determine IFW data type from a CII Cfg Node.
 

Publisher Status names.

constexpr auto ifw::ccf::PUB_STAT_NAME_ACTIVE = "Active"
 
constexpr auto ifw::ccf::PUB_STAT_NAME_COMPLETED = "Completed"
 
constexpr auto ifw::ccf::PUB_STAT_NAME_STOPPED = "Stopped"
 
constexpr auto ifw::ccf::PUB_STAT_NAME_ABORTED = "Aborted"
 
constexpr auto ifw::ccf::PUB_STAT_NAME_FAILED = "Failed"
 
constexpr auto ifw::ccf::PUB_STAT_NAME_UNDEFINED = "Undefined"
 
std::string ifw::ccf::RecStatusNameToStr (recif::RecStatusNames rec_status_nb)
 Recording Status name, number to string representation.
 
std::string ifw::ccf::PubStatusNameToStr (PubStatus pub_status_nb)
 Publisher status, number representation to string.
 
std::string ifw::ccf::BuildKey (const std::vector< std::string > &elements)
 Build a concatenated key from a number of elements (<el1>.<el2.>...).
 
std::vector< std::string > ifw::ccf::SplitKey (const std::string &key)
 Split up a concatenated key.
 

Macro Definition Documentation

◆ CCFDEBUG

#define CCFDEBUG ( msg)
Value:
do { \
fmt::print(stdout, "CCF-DEBUG#####>>>>> {}: {}\n", IFWLOC, msg); \
std::fflush(stdout); \
} while (0)

Used for debugging purposes to print out info to "stdout". It is attempted to flush the "stdout" file descriptor to ensure the message is displayed on "stdout".

◆ CCFTHROW

#define CCFTHROW ( msg)    throw rad::Exception(IFWLOC + ": " + msg)

Throw a "rad::Exception()". The location ("IFWLOC") for the throw statement is added to the message.

◆ CCFTIME

#define CCFTIME   ifw::core::utils::time::Time()