////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] fractions (--) Array of trace compound mole fractions to read from.
/// @param[in] size      (--) Size of the given fractions array.
///
/// @details  Sets this object's trace compound mole fractions equal to the given values.  The given
///           array can be larger or smaller than our internal array.  If our array is larger, then
///           the remaining values in the our array are filled with zeroes.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[out] fractions (--) Array of bulk fluid mole fractions to write to.
/// @param[in]  size      (--) Size of the given fractions array.
///
/// @details  Sets the given bulk fluid mole fractions equal to this object's values.  The given
///           array can be larger or smaller than our internal array.  If our array is smaller, then
///           the remaining values in the given array are filled with zeroes.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[out] fractions (--) Array of trace compound mole fractions to write to.
/// @param[in]  size      (--) Size of the given fractions array.
///
/// @details  Sets the given builk trace compound fractions to this interface's values.  The given
///           array can be larger or smaller than our internal array.  If our array is smaller, then
///           the remaining values in the given array are filled with zeroes.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details  Default constructs this distributed fluid state data.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details  Default constructs this distributed flow state data.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details  Default constructs this Fluid Distributed 2-Way Bus interface data.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @returns  (--)  True if all data validation checks passed.
///
/// @details  Checks for all of the following conditions to be met:  Frame count > 0, energy > 0,
///           capacitance >= 0, pressure >= 0 (only in Supply mode), and all mixture fractions >= 0.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details  Default constructs this Fluid Distributed 2-Way Bus Interface.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] isPairMaster (--) True if this is the master side of the interface, for tie-breaking.
/// @param[in] nIfBulk      (--) Number of bulk fluid constituents in the interface data.
/// @param[in] nIfTc        (--) Number of trace compounds in the interface data.
///
/// @details  Initializes this Fluid Distributed 2-Way Bus Interface.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] fluid (--) The fluid state in the interface volume.
///
/// @details  When this in the Supply role, this copies the given fluid state, describing the fluid
///           state in the interface volume, into the outgoing interface data for transmission to
///           the other side.
///
/// @note  This should only be called when this interface is in the Supply role, and this will push
///        a warning notification if called in the Demand role.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[out] fluid (--) The fluid state in the interface volume.
///
/// @returns  bool (--) True if the supplied fluid state object was updated, otherwise false.
///
/// @details  When in the Demand role, this copies the received interface volume fluid state from
///           the other side of the interface into the supplied state object.  The local model
///           should drive their interface volume to this fluid state boundary condition.
///
/// @note  The supplied fluid state object is not updated if this interface is not in the Demand
///        role, or if Supply role data has not been received from the other side, which can happen
///        briefly during run start or role swaps.  The returned bool value indicates whether the
///        supplied fluid state object was updated.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] flow (--) The flow state to/from the interface volume.
///
/// @details  When this in the Demand role, this copies the given flow state, describing the flow
///           state to or from the interface volume, into the outgoing interface data for
///           transmission to the other side.  By convention, positive flow rate values are for flow
///           pulled from the interface volume into the local Demand-side model, i.e. flow from the
///           Supply side to the Demand side, and negative flow rates are flow from the Demand side
///           to the Supply side.
///
/// @note  This should only be called when this interface is in the Supply role, and this will push
///        a warning notification if called in the Demand role.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[out] flow (--) The flow state to/from the interface volume.
///
/// @returns  bool (--) True if the supplied flow state object was updated, otherwise false.
///
/// @details  When in the Supply role, this copies the received interface flow state from the other
///           side of the interface into the supplied flow state object.  The local model should
///           apply this flow to or from their interface volume model.  By convention, positive flow
///           rate values are for flow pulled from the interface volume into the local Demand-side
///           model, i.e. flow from the Supply side to the Demand side, and negative flow rates are
///           flow from the Demand side to the Supply side.  This means that the local Supply volume
///           model should subtract the integral of the given flow rate from its fluid mass.
///
/// @note  The supplied flow state object is not updated if this interface is not in the Supply
///        role, or if Demand role data has not been received from the other side, which can happen
///        briefly during run start or role swaps.  The returned bool value indicates whether the
///        supplied flow state object was updated.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details  Processes incoming data from the other side of the interface: checks for role swaps,
///           and updates the frame counters and loop latency measurement.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] timestep           (s)  Model integration time step.
/// @param[in] demandSidePressure (Pa) Model pressure adjacent to the interface volume.
///
/// @details  Calculates and returns the maximum limit on molar flow rate between the Demand-side
///           model and the interface volume, based on data loop latency, and relative pressures and
///           capacitances of the interfacing sides.  When the Demand-side model limits its flow
///           rate to/from the interface volume to this limit, the interface will be stable.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details  Handles mode flips in response to incoming data, and the initial mode flip at run
///           start.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details  Flips from supply to demand mode whenever the supply side capacitance drops below
///           some fraction of the demand side's capacitance.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details  Processes flipping to Demand mode.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details  Processes flipping to Supply mode.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details  Final updates for output data before transmission to the other side.  Sets outputs
///           capacitance to the given value.  Flips from Supply to Demand role if the new
///           capacitance is low enough, and updates the count of frames since the last mode flip.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] volume        (m3)      Air volume.
/// @param[in] temperature   (K)       Air temperature.
/// @param[in] pressure      (Pa)      Air pressure.
/// @param[in] moleFractions (--)      Compound mole fractions of the air mixture.
/// @param[in] compoundCp    (J/mol/K) Specific heats of the chemical compounds in the air mixture.
/// @param[in] isIfMaster    (--)      This is the master side of the Distributed Fluid Interface pairing.
/// @param[in] isIfEnthalpy  (--)      The Fluid Distributed Interface transports energy as specific enthalpy instead of temperature.
///
/// @details  Default constructs this Simple Cabin Atmosphere Volume Model Configuration Data.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] name (--) Name of this object for output messages.
///
/// @details  Default constructs this Simple Cabin Atmosphere Volume Model.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] config (--) The configuration data for this object.
///
/// @details  Initializes this Simple Cabin Atmosphere Volume Model with its configuration data.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in, out] name (--) The given name string to convert.
///
/// @details  Replaces any '.' with '__', so the name string can be given to Trick Memory Manager as
///           the allocation name.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details  Computes and stores the air moles from the air volume, pressure and temperature by the
///           Ideal Gas Law.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details  To avoid divide-by-zero and arithmetic underflows, prevent moles from reaching zero.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] moles (--) Moles of fluid to compute the pressure for.
///
/// @returns  double (Pa) Pressure.
///
/// @details  Computes and returns the air pressure from the given moles and the current volume and
///           temperature, by the Ideal Gas Law.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details  Updates the volume pressure to match its current state.  This is skipped if the
///           Distributed Interface is in Demand role with valid received Supply data, since this
///           volume will constrain its pressure to match the Supply value.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] enthalpy (J/mol) Specific enthalpy of the air to calculate the temperature for.
///
/// @returns  double (K) Temperature.
///
/// @details  Computes and returns the air temperature for the given specific enthalpy and the
///           current mixture specific heat, by T = h/Cp assuming calorically perfect gas.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] temperature (K) Temperature of the air to calculate the specific enthalpy for.
///
/// @returns  double (J/mol) Specific enthalpy.
///
/// @details  Computes and returns the air specific enthalpy for the given temperature and the
///           current mixture specific heat, by h = Cp*T assuming calorically perfect gas.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] moles          (mol)   The quantity of moles to be added or removed.
/// @param[in] enthalpy       (J/mol) Specific enthalpy of the moles being added or removed.
/// @param[in] moleFractions  (--)    The mole fractions of the mixture being added or removed.
///
/// @details  Adds the given amount of moles with given specific enthalpy and mixture to the inflow
///           collection state when this volume is constrained to the Supply state (Demand role), or
///           to this volume's contents when not constrained (Supply role).  A negative value for
///           moles causes the given mixture to be removed instead.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] moles    (mol)   The quantity of moles to be added or removed.
/// @param[in] enthalpy (J/mol) Specific enthalpy of the moles being added or removed.
/// @param[in] mixture  (--)    The mixture data object for the moles being added or removed.
///
/// @details  This overloaded function calls addMixture with the mole fractions array from the given
///           mixture data object.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] moles (mol) The quantity of moles to be removed.
///
/// @details  Removes the given quantity of moles from this volume's contents.  We don't remove the
///           moles when in Demand role because the contents of this volume are constrained to the
///           values from the Supply side.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] energy       (--)      Energy term in the Fluid Distributed Interface data (K) or (J/mol).
/// @param[in] specificHeat (J/mol/K) Specific heat of the mixture for converting to temperature.
///
/// @returns  double (J/mol) Specific enthalpy represented by the energy term.
///
/// @details  Returns the specific enthalpy represented by the given energy value from this volume's
///           Fluid Distributed Interface.  If the interface is configured to represent energy as
///           specific enthalpy, then the given energy value is simply returned.  Otherwise, the
///           energy value represents temperature, and is converted to specific enthalpy by the
///           given specific heat.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] temperature  (K)       Temperature for the Fluid Distributed Interface energy term.
/// @param[in] specificHeat (J/mol/K) Specific heat of the mixture for converting to specific enthalpy.
///
/// @returns  double (--) Specific enthalpy (J/mol) or temperature (K) represented by the energy term.
///
/// @details  Returns the energy term for this volume's Fluid Distributed Interface represented by
///           the given temperature value.  If the interface is configured to represent energy as
///           temperature, then the given energy value is simply returned.  Otherwise, the energy
///           value represents specific enthalpy, and is converted from temperature by the given
///           specific heat.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] dt          (s)  Time step of integration.
/// @param[in] demandSideP (Pa) Source or sink pressure on our side of the interface driving flow.
///
/// @details  Updates the Fluid Distributed Interface before the main CabinAtmo model update.
///           This does steps 2-6 of the local model interfaces to the Fluid Distributed Interface.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details  Updates the Fluid Distributed Interface after the main CabinAtmo model update.
///           This does steps 9-12 of the local model interfaces to the Fluid Distributed Interface.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details  Default constructs this FluidDistributedIfLagBuffer.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details  Initializes this FluidDistributedIfLagBuffer.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details  Updates the head & tail indexes, does the index wrap-around for the ring buffer, and
///           calls the interface data pointers to be updated.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details  Sets the interface Head & Tail data pointers to the current head & tail of the ring
///           buffers.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details  Constructs this Simple Cabin Atmosphere Conservation Check Parameters object.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] a    (--) Reference to the first CabinAtmo model's conservation parameters.
/// @param[in] b    (--) Reference to the second CabinAtmo model's conservation parameters.
///
/// @details  Constructs this Simple Cabin Atmosphere Conservation Checks object.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details  Sums the current parameter totals, sets the new reference values on command, and
///           computes error between the current values and their reference values.
///
/// @note  Because of lag in the data interface between models A & B, the computed errors are only
///        are only accurate when flows between A and B are zero or A and B are completely mixed.
///        These errors will also momentarily spike and be incorrect during Supply/Demand role swap.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details  Constructs this Simple Cabin Atmosphere Air Mixture Data object.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] moleFractions (--)      The initial mole fractions array.
/// @param[in] compoundCp    (J/mol/K) Specific heat constants for the compounds in air.
///
/// @details  Initializes this object with the given initial mole fractions.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @returns bool (--) True if the mole fractions do not sum to 1.
///
/// @details  Sums the mMoleFractions and checks the sum is equal to within numerical precision of
///           1.  Returns true if it does not sum to 1.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details  Computes and sets the specific heat of this object as the average of the compound
///           specific heats, weighted by their mole fraction.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[out] moleFractions (--) The mole fractions array to be written to.
///
/// @details  Write this object's mixture into the given mole fractions array.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] moleFractions (--) The mole fractions array to be read from.
///
/// @details  Reads the given mole fractions array into this object's mixture.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] oldMoles     (mol) Existing mole quantity to be added to.
/// @param[in] addMoles     (mol) Quantity of moles that are to be added.
/// @param[in] addFractions (--)  Mixture of the moles that are to be added.
///
/// @details  Computes the resulting mixture (mole fractions) of adding the given amount of moles
///           with given mole fractions to the given amount of moles with this object's existing
///           mole fractions.  Stores the result as this object's new mole fractions, and updates
///           the specific heat for the new mixture.
///
/// @note     A negative value of addMoles can be used to removed the specified mixture from the
///           previous mixture.  Any negative mole fractions in the resulting mixture are zeroed.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details  Normalizes this object's mole fractions array so the sum equals exactly 1.  If the
///           mole fractions currently sum to zero, then the mixture is reset to all the first
///           compound.  Negative fractions are zeroed.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] level   (--) Severity level of the message.
/// @param[in] message (--) Detailed message string.
///
/// @details  Adds a new notification message object to the message queue.
////////////////////////////////////////////////////////////////////////////////////////////////////


/*!
 * @details From the TrickHLA::Conditional class. We override this function
 * so that we can initialize references to the TrickHLA::Attribute's that are
 * used in the should_send function to determine if an attribute value should
 * be sent.
 *
 * @job_class{initialization}
 */


/*!
 * @brief Set the name of the sine wave object.
 * @param new_name The name of the sine wave object.
 */


/*!
 * @details Use the initialize callback function as a way to setup
 * TrickHLA::Attribute references which are used to determine ownership or if
 * data for an attribute was received.
 * @job_class{initialization}
 */


/*!
 * @brief Send side lag-compensation where we propagate the sine wave state
 *  head by dt to predict the value at the next data cycle.
 */


/*!
 * @brief When lag compensation is disabled, this function is called to
 * bypass the send side lag compensation and your implementation must copy
 * the sim-data to the lag-comp data to effect the bypass.
 */


/*!
 * @brief Receive side lag-compensation where we propagate the sine wave
 * state ahead by dt to predict the value at the next data cycle.
 */


/*!
 * @brief When lag compensation is disabled, this function is called to
 * bypass the receive side lag compensation and your implementation must
 * copy the lag-comp data to the sim-data to effect the bypass. You must
 * make sure to check the lag-comp data was received before copying to
 * the sim-data otherwise you will be copying stale data.
 */


/*!
 * @details From the TrickHLA::OwnershipHandler class. We override this
 * function so that we can initialize ownership transfer of some attributes
 * at a specific time.
 *
 * @job_class{initialization}
 */


/*!
 * @details From the TrickHLA::Packing class. We override this function so
 * that we can initialize references to the TrickHLA::Attribute's that are
 * used in the unpack function to handle attribute ownership and different
 * attribute data rates. Use the initialize callback function as a way to
 * setup TrickHLA-Attribute references which are used to determine ownership
 * or if data for an attribute was received.
 *
 * @job_class{initialization}
 */


// Add waypoints to the waypoint queue


// Controls the vehicle. If the vehicle is the subscriber, it will follow the vehicle publishing its
// location.


// Prints out waypoint queue - useful for debugging.


// Prints out STCS array - useful for debugging.


// Adds waypoint to queue using position data received from publishing vehicle.


// Commands wheelbot to navigate to home


// Prints destination - useful for debugging.


// This is how the publishing vehicle will update its navigation.


// Function for subscribing vehicle to update its navigation based on the position data
// received from the publishing vehicle.


/*!
 * @details Called from the virtual destructor.
 * @job_class{shutdown}
 */


/*!
 * @details If the manager does not exist, -1.0 seconds is assigned to the returned object.
 */


/*!
 * @details If the manager does not exist, Int64BaseTime::get_max_logical_time_in_seconds()
 * is assigned to the returned object.
 */


/*!
 * @details Get the current time of day for this timeline.
 */


/*!
 * @details Get the minimum time resolution, which is the smallest time
 * representation for this timeline.
 */


/*!
 *  @details If the manager does not exist, -1.0 seconds is assigned to the returned object.
 */


/*!
 *  @details If the object does not exist, Int64BaseTime::get_max_logical_time_in_seconds()
 *  is assigned to the returned object. */


/*! @brief Compute a simulation time from a given scenario time.
 *  @return Simulation time in seconds.
 *  @param scenario_time Desired scenario time in seconds. */


// Current time as an integer in microseconds.


/*! @brief Reset the internal timeout time. */


/*!
 * @brief Initialize the callback object to the supplied Object pointer.
 * @param obj Associated object for this class.
 */


/*!
 * @brief Setup the required class instance associations.
 * @param federate Associated TrickHLA::Federate class instance.
 * @param manager  Associated TrickHLA::Manager class instance.
 */


/*!
 * @brief Initialize the thread memory associated with the Trick child threads.
 */


/*!
 * @brief Disable the comma separated list of Trick child thread IDs associated to TrickHLA.
 */


/*!
 * @brief Associate a Trick child thread with TrickHLA.
 */


/*!
 * @brief Verify the threads IDs associated to objects in the input file.
 * */


/*!
 * @brief Announce all the HLA data was sent.
 */


/*!
 * @brief Wait for the HLA data to be sent if a Trick child thread or if the
 * calling thread is the Trick main thread then wait for all associated Trick
 * child threads to have called this function.
 */


/*!
 * @brief Wait for the HLA data to be sent for all Trick child threads.
 */


/*! @brief Wait to receive data when the Trick main thread is ready. */


/*! @brief On boundary if sim-time is an integer multiple of a valid cycle-time. */


/*! @brief Get the data cycle time for the specified object index, otherwise
 * return the default data cycle time. */


/*!
 * \par<b>Assumptions and Limitations:</b>
 * - The TrickHLA::ExecutionConfigurationBase class is actually an abstract class.
 * Therefore, the actual object instance being passed in is an instantiable
 * polymorphic child of the TrickHLA::ExecutionConfigurationBase class.
 *
 * @job_class{default_data}
 */


/*!
 * \par<b>Assumptions and Limitations:</b>
 * - This assumes that the TrickHLA::ExecutionConfigurationBase instance is
 * set elsewhere.
 *
 * @job_class{default_data}
 */


/*!
 * @brief Is the specified sync-point label contained in the multiphase init
 *  sync-point list.
 * @param sync_point_label Name of the synchronization point label.
 * @return True if the multiphase init sync-point list contains the sync-point,
 *  false otherwise.
 */


/*!
 * @details WARNING: Only the Master federate should ever set this.
 */


/*!
 * @details Frees memory allocated, and remove this object from the federation
 * execution.
 * @job_class{shutdown}
 */


/*!
 * @details Turns off the local flag for all attributes in this object. This
 * is needed so when an object pushed the ownership of its attributes and
 * disappears before pulling the ownership back or the object resigns from the
 * federation, the object which received the ownership does not have delete
 * privilege (that disappeared with the declaring object) so it must not
 * continue to publish the deleted object's data. This also applies to
 * attributes of an object that resigns from the federation.
 */


/*!
 * @details Calling this function will block until the object instance name is
 * reserved, but only if the object is locally owned.
 * @job_class{initialization}
 */


/*!
 * @details Calling this function will block until the object instance is registered.
 * @job_class{initialization}
 */


/*!
 * @details This routine is called by the federate ambassador when new
 * attribute values come in for this object.
 * @job_class{scheduled}
 */


/*!
 * @brief Pull ownership of the named object instance at initialization.
 * @param attribute_list Comma separated list of attributes FOM names.
 * */


/*!
 * @brief Wait to handle the remote request to Pull ownership object
 *  attributes to this federate. */


/*!
 * @brief The function that runs in the push P-thread that handles the push
 * request grant.
 * @details This function is local to this file and is NOT part of the class.
 * @return Void pointer and is always NULL.
 * @param arg Arguments list.
 * @job_class{scheduled}
 */


/*!
 * @brief The function that runs in the ownership divestiture P-thread that
 * handles ownership transfer.
 * @details This function is local to this file and is NOT part of the class.
 * @return Void pointer and is always NULL.
 * @param arg Arguments list.
 * @job_class{scheduled}
 */


/*!
 * @brief Push ownership of the named object instance at initialization.
 * @param obj_instance_name Object instance name to push ownership
 * of for all attributes.
 * @param attribute_list Comma separated list of attribute FOM names.
 */


/*!
 * @brief Wait to handle the remote request to Push ownership object
 *  attributes to this federate.
 *  */


// WARNING: Only call this function once per data cycle because of how the
// attribute data ready is determined per cycle.


/*! @brief Determine if this object is associated to the specified thread ID.
 * @return True associated to this thread ID.
 * @param thread_id Trick thread ID. */


/*!
 * @details In most cases, we would allocate and set default names in the
 * constructor. However, since we want this class to be Input
 * Processor friendly, we cannot do that here since the Input
 * Processor may not have been initialized yet. So, we have to
 * set the name information to NULL and then allocate and set the
 * defaults in the initialization job if not already set in the
 * input stream.
 * @job_class{initialization}
 */


/////////////////////////////////////
// Declaration Management Services //
/////////////////////////////////////


//////////////////////////////
// Time Management Services //
//////////////////////////////


/*!
 * @brief Send side lag compensation callback.
 */


/*!
 * @brief Receive side lag compensation callback.
 */


/*! @brief Get the Attribute by FOM name.
 *  @return Attribute for the given name.
 *  @param attr_FOM_name Attribute FOM name.
 */


/*!
 *  @details If the attribute is not found then an error message is displayed
 *  then exec-terminate is called.
 */


/*! @brief Returns a copy of the object's lookahead time.
 *  @return A copy of the federate's lookahead time.
 */


/*! @brief Returns a copy of the object's granted federation time.
 *  @return A copy of the federate's current granted time.
 */


/*! @brief Returns the current scenario time.
 *  @return Current scenario time.
 */


/*! @brief Returns the current Central Timing Equipment (CTE) time.
 *  @return Current CTE time.
 */


/*!
 * @brief Prints the 'head' pointers for all elements in the queue.
 * @param name Name of the caller.
 * */


/*!
 * @brief Sets head to the passed-in element's next value.
 * @param item Item to extract the 'next' data pointer.
 */


/*!
 * @brief Pop an item off the queue.
 */


/*!
 * @brief Push the item onto the queue.
 * @param item Item to put into the queue.
 */


/*!
 * @brief Re-established original 'head' queue pointer after the queue has
 *  been walked.
 */


/*!
 * @details Frees the Trick allocated memory.
 * @job_class{shutdown}
 */


/*!
 * \par<b>Assumptions and Limitations:</b>
 * - The TrickHLA::ExecutionControlBase class is actually an abstract class.
 * Therefore, the actual object instance being passed in is an instantiable
 * polymorphic child of the TrickHLA::ExecutionControlBase class.
 *
 * @job_class{default_data}
 */


/*! @brief Verify the user specified object and interaction arrays and counts. */


/*!
 * @details Calling this function will block until all the object instances
 * names for the locally owned objects have been reserved.
 * @job_class{initialization}
 */


/*!
 * @details Calling this function will block until all the required object
 * instances in the Federation have been registered.
 * @job_class{initialization}
 */


/*!
 * @details If the object is owned remotely, this function copies its internal
 * data into simulation object and marks the object as "unchanged". This data
 * was deposited by the reflect callback and marked as "changed". By marking
 * it as unchanged, we avoid copying the same data over and over. If the object
 * is locally owned, we shouldn't be receiving any remote data anyway and if
 * we were to -- bogusly -- copy it to the internal byte buffer, we'd
 * continually reset our local simulation.
 * @job_class{scheduled}
 */


/*!
 * @brief Blocking function call to pull ownership of the named object
 * instance at initialization.
 * @param obj_instance_name Object instance name to pull ownership
 *  of for all attributes.
 */


/*!
 * @brief Blocking function call to pull ownership of the named object
 * instance at initialization.
 * @param obj_instance_name Object instance name to pull ownership
 * of for all attributes
 * @param attribute_list Comma separated list of attributes.
 */


/*!
 * @brief Blocking function call to wait to handle the remote request to Pull
 * ownership object attributes to this federate.
 * @param obj_instance_name Object instance name to handle the remote
 *  pulled ownership attributes from.
 */


/*!
 * @brief Blocking function call to push ownership of all the locally owned
 * object attributes.
 * @param obj_instance_name Object instance name to push ownership
 * of for all attributes.
 */


/*!
 * @brief Blocking function call to push ownership of the named object
 * instance at initialization.
 * @param obj_instance_name Object instance name to push ownership
 * of for all attributes.
 * @param attribute_list Comma separated list of attribute FOM names.
 */


/*!
 * @brief Blocking function call to wait to handle the remote request to
 * Push ownership object attributes to this federate.
 * @param obj_instance_name Object instance name to handle the remote
 * pushed ownership attributes from.
 */


/*!
 * @details Trigger federation save, at current time or user-specified time.\n
 * NOTE: These routines do not coordinate a federation save via interactions
 * so make these internal routines so that the user does not accidentally call
 * them and mess things up.
 */


/*!
 * @details Calling this function will block until object instances have been
 * discovered.
 * @job_class{initialization}
 */


/*!
 * @details If they have, true is returned if the 'create HLA instance' object
 * was discovered. If no discoveries took place or if the required
 * 'create HLA instance' object was not discovered, false is returned.
 * @job_class{initialization}
 */


/*!
 * @brief Initialize the mutex.
 * @return Integer value of 0 for success, otherwise non-zero for an error.
 */


/*!
 * @brief Destroy the mutex lock.
 * @return Integer value of 0 for success, otherwise non-zero for an error.
 */


/*!
 * @brief Get the Attribute by FOM name.
 * @return Attribute for the given name.
 * @param attr_FOM_name Attribute FOM name.
 */


/*!
 * @brief This function returns the Attribute for the given attribute FOM name.
 * @return Attribute for the given name.
 * @param attr_FOM_name Attribute FOM name.
 */


/*!
 * @brief Get the current scenario time.
 * @return Returns the current scenario time.
 */


/*!
 * @brief Get the current Central Timing Equipment (CTE) time.
 * @return Returns the current CTE time.
 */


/*!
 * @details This is a pure virtual destructor.
 * @job_class{shutdown}
 */


/*
 * Does the names list contain the sync-point label.
 */


// True if at least one sync-point is registered.


// Callback from FedAmb.


/*!
 * @brief Update the clock tics per second resolution of this clock
 *  to match the Trick executive resolution.
 */


/*!
 * @details Get the global time in seconds based on the CTE.
 */


/*!
 * @details Set the global "the_clock" pointer to this instance.
 */


/*!
 * @details Call the system clock_gettime to get the current real time with
 * a resolution set by Clock::clock_tics_per_sec.
 */


/*!
 * @details This function is empty
 */


/*!
 * @details NOTE: In most cases, we would allocate and set default names in
 * the constructor. However, since we want this class to be Input Processor
 * friendly, we cannot do that here since the Input Processor may not have
 * been initialized yet. So, we have to set the name information to NULL and
 * then allocate and set the defaults in the initialization job if not
 * already set in the input stream.
 *
 * @job_class{initialization}
 */


/*!
 * @details Free up the Trick allocated memory associated with the attributes
 * of this class.
 * @job_class{shutdown}
 */


/*!
 * @details Check that the FPU Control Word matches the value at simulation
 *  startup. If not it will reset it back to the startup value. It will use
 *  the FPU Control Word value set by the Python Input Processor.
 */


/*!
 * \par<b>Assumptions and Limitations:</b>
 * - The TrickHLA::FedAmb class is actually an abstract class. Therefore,
 * the actual object instance being passed in is an instantiable polymorphic
 * child of the RTI1516_NAMESPACE::FederateAmbassador class.
 *
 * - The TrickHLA::ExecutionControlBase class is actually an abstract class.
 * Therefore, the actual object instance being passed in is an instantiable
 * polymorphic child of the TrickHLA::ExecutionControlBase class.
 *
 * @job_class{default_data}
 */


/*! @brief Initialization the debug settings, show the version and apply
 * the FPU control word fix. */


/*!
 * \par<b>Assumptions and Limitations:</b>
 * - The TrickHLA::FedAmb class is actually an abstract class. Therefore,
 * the actual object instance being passed in is an instantiable polymorphic
 * child of the RTI1516_NAMESPACE::FederateAmbassador class.
 * @job_class{initialization}
 */


/*!
 * @details This performs all the startup steps prior to any multi-phase
 * initialization process defined by the user. The multi-phase initialization
 * will be performed as initialization jobs between P_INIT and P_LAST
 * phased initialization jobs.
 *
 * @job_class{initialization}
 */


/*!
 * @details This performs all the startup steps after any multi-phase
 * initialization process defined by the user.
 *
 * @job_class{initialization}
 */


/*!
 * \par<b>Assumptions and Limitations:</b>
 * - Currently only used with SRFOM initialization schemes.
 *  @job_class{freeze_init}
 */


/*!
 * \par<b>Assumptions and Limitations:</b>
 * - Currently only used with DIS and IMSIM initialization schemes.
 *  @job_class{unfreeze}
 */


/*!
 * \par<b>Assumptions and Limitations:</b>
 * - Currently only used with DIS and IMSIM initialization schemes.
 */


/*!
 *  \par<b>Assumptions and Limitations:</b>
 *  - Currently only used with DIS and IMSIM initialization schemes.
 *  @job_class{freeze}
 */


/*!
 *  \par<b>Assumptions and Limitations:</b>
 *  - Currently only used with IMSim initialization scheme.
 *  @job_class{checkpoint}
 */


/*!
 *  \par<b>Assumptions and Limitations:</b>
 *  - Currently only used with DIS and IMSIM initialization schemes.
 *  @job_class{post_checkpoint}
 */


/*!
 *  \par<b>Assumptions and Limitations:</b>
 *  - Currently only used with DIS and IMSIM initialization schemes.
 *  @job_class{preload_checkpoint}
 */


/*!
 *  \par<b>Assumptions and Limitations:</b>
 *  - Currently only used with DIS and IMSIM initialization schemes.
 */


/*! @brief Set the time advance as granted. */


/*! @brief Update the HLA lookahead base time. */


/*! @brief Enable time regulating.
 *  @param time the granted HLA Logical time */


/*!
 * @brief Verify the thread IDs associated to the objects.
 */


/*! @brief Get the data cycle time for the configured object index or return
 * the default data cycle time otherwise. */


/*! @brief Is the object for the given index on a data cycle boundary. */


/*!
 * @brief Send zero lookahead or requested data for the specified object instance.
 * @param obj_instance_name Object instance name to send data for.
 */


/*!
 *  @brief Blocking function call to wait to receive the zero lookahead data
 *  for the specified object instance.
 *  @param obj_instance_name Object instance name to wait for data.
 */


/*!
 * @brief Send blocking I/O or requested data for the specified object instance.
 * @param obj_instance_name Object instance name to send data for. */


/*!
 * @brief Blocking function call to wait to receive the blocking I/O data
 * for the specified object instance.
 * @param obj_instance_name Object instance name to wait for data.
 */


/*!
 *  @details Shutdown the federate by shutting down the time management,
 *  resigning from the federation, and then attempt to destroy the federation.
 *  @job_class{shutdown}
 */


/*!
 *  @details Shutdown this federate's time management by shutting down time
 *  constraint management and time regulating management.
 *  @job_class{shutdown}
 */


/*!
 *  @details Resign from the federation but divest ownership of my attributes
 *  and do not delete the federate from the federation when resigning.
 *  @job_class{logging}
 */


//**************************************************************************
//**************************************************************************
//*************** START OF CHECKPOINT / RESTORE CODE ***********************
//**************************************************************************
//**************************************************************************


/*!
 * \par<b>Assumptions and Limitations:</b>
 * - Currently only used Used with IMSIM initialization scheme; only for restore at simulation startup.
 *  @job_class{environment}
 */


/*!
 * @details Returns true if the supplied name is a required startup federate
 * or an instance object of a required startup federate.
 * \par<b>Assumptions and Limitations:</b>
 * - Assumes that the instance attributes' object name is in the format
 * 'object_name.FOM_name'. Otherwise, this logic fails.
 */


/*!
 * @details Frees allocated memory.
 * @job_class{shutdown}
 */


/*!
 * \par<b>Assumptions and Limitations:</b>
 * - The destination must be large enough to hold size bytes of data.
 */


/*!
 * @details Unlocks the mutex.
 * @job_class{shutdown}
 */


/*!
 * @brief Constructor with base units_string specified.
 * @param units The base time units to use.
 */


/*!
 * @brief Determine if the specified value exceeds the base time resolution.
 * @param units The base time units to use.
 */


/*!
 * @brief A string representing the specified units.
 * @param units The base time units.
 * @return A string representing the specified units.
 */


/*!
 * @brief Determine the best supporting base time resolution for the value.
 * @return The best supporting base time enum value.
 * @param value Time value as a floating point double in seconds.
 */


/*!
 * @brief Determine if the specified value exceeds the resolution of
 *  the base time (i.e. value is much smaller than base time resolution).
 *  @return True if the value exceeds the resolution of the base time.
 * @param value Time value as a floating point double in seconds.
 */


/*!
 * @brief Determine if the specified value exceeds the resolution of
 *  a base time with the corresponding multiplier.
 * @return True if the value exceeds the resolution of the base time.
 * @param value Time value as a floating point double in seconds.
 * @param multiplier Base time multiplier.
 */


/*!
 * @brief Converts the given floating point time to an integer representing
 *  the time in the HLA Logical base time.
 * @return Time value in the HLA Logical base time.
 * @param value Time value as a floating point double in seconds.
 */


/*!
 * @brief Converts the given integer time to an floating-point time representing seconds.
 * @return Time value in seconds.
 * @param time_in_base_units Time value as a 64-bit integer in the units_string specified for this class.
 */


/*!
 * @brief Converts the given integer time to an integer time representing whole seconds.
 * @return Time value in whole seconds.
 * @param time_in_base_units Time value as a 64-bit integer in the units_string specified for this class.
 */


/*!
 * @details This routine will set a lot of the data in the TrickHLA::Federate that
 * is required for this execution control scheme. This should greatly simplify
 * input.py files and reduce input.py file setting errors.
 * @job_class{initialization}
 */


/*!
@details This routine implements the TrickHLA Join Federation Process described.

@job_class{initialization}
*/


/*!
@details This routine implements the TrickHLA pre multi-phase initialization process.

@job_class{initialization}
*/


/*!
@details This routine implements the TrickHLA post multi-phase initialization process.

@job_class{initialization}
*/


/*!
 * \par<b>Assumptions and Limitations:</b>
 * - Called from the ExCO unpack routine.
 *
 * @job_class{scheduled}
 */


/*!
 * @details Calling this function will block until the execution configuration
 * object instance in the Federation has been registered.
 * @job_class{initialization}
 */


/*!
 * @details Get the minimum time resolution in seconds, which is the smallest
 * time representation for this timeline.
 */


/*!
 * @details Even though this is a pure virtual destructor, we provide a
 * default implementation that can be called from an inheriting class.
 * @job_class{shutdown}
 */


/*!
 * @details These can be overridden in the input.py file.
 * @job_class{default_data}
 */


/*!
 * @job_class{initialization}
 * NOTE: The initialize( manager ) function must be called before this function.
 */


/*!
@details This function is called before the data is sent to the RTI.
*/


/*!
@details This function is called after data is received from the RTI.
*/


/*!
 * @details WARNING: This function is BROKEN!
 */


/*!
 * @details The endianess of the computer is determined as part of the
 * Attribute construction process.
 * @job_class{initialization}
 */


/*!
 * @details The buffer and ref2 values are freed and nulled.
 * @job_class{shutdown}
 */


/*! @details If the attribute is static in size it uses a cached size value
 * otherwise the size is calculated. */


/*! @details If the attribute is not for an array then a value of one is
 * set in the num_items variable. Otherwise the number of items in the static
 * array are set in the num_items variable.
 *
 * \par<b>Assumptions and Limitations:</b>
 * - Only static arrays are supported for now.
 */


/*! @details
 * \par<b>Assumptions and Limitations:</b>
 * - The destination must be large enough to hold num_bytes of data.
 * - Only primitive types and static arrays of primitive type are supported for now.
 */


/*! @details
 * \par<b>Assumptions and Limitations:</b>
 * - Only primitive types and static arrays of primitive type are supported for now.
 */


/*!
 * @details If the parameter is static in size it uses a cached size value
 * otherwise the size is calculated.
 */


/*!
 * @details If the parameter is not for an array then a value of one is
 * returned. Otherwise the number of items in the static array are returned.
 * \par<b>Assumptions and Limitations:</b>
 * - Only static arrays are supported for now.
 * @job_class{initialization}
 */


/*!
 * \par<b>Assumptions and Limitations:</b>
 * - The destination must be large enough to hold num_bytes of data.
 * - Only primitive types and static arrays of primitive type are supported
 * for now.
 */


/*!
 * \par<b>Assumptions and Limitations:</b>
 * - Only primitive types and static arrays of primitive type are supported
 * for now.
 */


/*!
@details This routine will set a lot of the data in the TrickHLA::Federate that
is required for this execution control scheme. This should greatly simplify
input.py files and reduce input.py file setting errors.

@job_class{initialization}
*/


/*!
@details This routine implements the IMSim Join Federation Process described
in section 7.2 and figure 7-3.

@job_class{initialization}
*/


/*!
@details This routine implements the IMSim pre multi-phase initialization process.

@job_class{initialization}
*/


/*!
@details This routine implements the IMSim post multi-phase initialization process.

@job_class{initialization}
*/


/*!
 * @details This routine is used to perform and inline build of the Trick
 * ref ATTRIBUTES for the IMSim freeze interaction.
 * This is used by federates, other than the Master, to request mode
 * transitions.
 *
 * @job_class{initialization}
 */


/*! Add initialization synchronization points to regulate startup. */


// FIXME: See if this is still needed. Trick 17 may have fixed this.
/*!
 *  @details Note that we could just have one check_pause routine and 2
 *  instances of it in the S_define file (one would be an initialization job
 *  and one would be a logging job). But early Trick 10 versions cannot
 *  distinguish between multiple instances when setting job cycle, so having
 *  this check_pause_at_init routine solves that problem.
 *  @job_class{initialization}
 */


/*!
 *  @details If found, clears the element, registers the FEDSAVE_v2 sync point
 *  with the RTI if we are the master federate and returns true. Otherwise,
 *  when a freeze interaction time was not found, false is returned.
 */


/*!
 *  @details This routine will block on the FEDSAVE_SYNC_POINT synchronization
 *  point until it is achieved and Save is initiated.
 */


/*!
 *  @details The interaction time is computed to be the current granted time
 *  plus lookahead. If the supplied time does not fall on the HLA and lookahead
 *  time boundaries, the time is rounded up to the next highest integer
 *  multiple of the lookahead time. If the time is less than the granted time
 *  plus one lookahead, this means that the freeze time is invalid so it is
 *  updated to be 'granted time plus one lookahead'. If the federate is a
 *  late-joining federate, the freeze time is slipped one frame because it
 *  would occur in a previous frame when the other non-late-joiner federates
 *  receive the freeze interaction time.
 */


/*!
 * @details This routine is used to perform and inline build of the Trick
 * ref ATTRIBUTES for the SpaceFOM Mode Transition Request (MTR) interaction.
 * This is used by federates, other than the Master, to request mode
 * transitions.
 *
 * @job_class{initialization}
 */


/*!
@details This routine implements the SpaceFOM Join Federation Process described
in section 7.2 and figure 7-3.

@job_class{initialization}
*/


/*!
@details This routine implements the SpaceFOM Role Determination Process
described in section 7.2 and figure 7-4.

@job_class{initialization}
*/


/*!
@details This routine implements the SpaceFOM Master and Early Joiner HLA
initialization process described in section 7.2 and figure 7-5.

@job_class{initialization}
*/


/*!
@details This routine implements the SpaceFOM Designated Late Joiner
initialization process that achieves any unknown announced sync-points and
waits for the initialization_complete sync-point to be announced.

@job_class{initialization}
*/


/*!
@details This routine implements the SpaceFOM Late Joiner initialization process
described in section 7.2 and figure 7-9.

@job_class{initialization}
*/


/*!
@details This routine implements the SpaceFOM pre multi-phase initialization
process described in section 7.2 figure 7-2.

@job_class{initialization}
*/


/*!
@details This routine implements the SpaceFOM post multi-phase initialization
process described in section 7.2 and figures 7-8 and 7-9.

@job_class{initialization}
*/


/*!
 * @details Calling this function will block until the all early joiner
 * federates have discovered the root reference frame and achieved the
 * root_frame_discovered synchronization point.
 * @job_class{initialization}
 */


/*!
 * @details NOTE: If a shutdown has been announced, this routine calls the
 * Trick exec_teminate() function. So, for shutdown, it should never return.
 * @job_class{shutdown}
 */


/*!
 * \par<b>Assumptions and Limitations:</b>
 * - Currently only used with SpaceFOM initialization schemes.
 *  @job_class{freeze_init}
 */


/*!
@details This routine implements the SpaceFOM Epoch and Root Reference Frame
Discovery initialization process described in section 7.2 and figure 7-6.

@job_class{initialization}
*/


/*!
 * @details From the TrickHLA::LagCompensation class. We override this function
 * so that we can initialize references to the TrickHLA::Attribute's that are
 * used in the unpack function to handle attribute ownership and different
 * attribute data rates.
 *
 * Use the initialize callback function as a way to setup TrickHLA::Attribute
 * references which are use to determine ownership or if data for an attribute
 * was received.
 *
 * @job_class{initialization}
 */


/*! @brief Initialization integration states. */


/*! @brief Sending side latency compensation callback interface from the
 *  TrickHLALagCompensation class. */


/*! @brief Receive side latency compensation callback interface from the
 *  TrickHLALagCompensation class. */


/*!
 * @details These can be overridden in the input file.
 * @job_class{initialization}
 */


/*!
 * @details From the TrickHLA::Packing class. We override this function so
 * that we can initialize references to the TrickHLA::Attribute's that are
 * used in the unpack function to handle attribute ownership and different
 * attribute data rates.
 *
 * Use the initialize callback function as a way to setup TrickHLA::Attribute
 * references which are use to determine ownership or if data for an attribute
 * was received.
 *
 * @job_class{initialization}
 */


/*!
 * @job_class{scheduled}
 * @brief Pre-multiply a quaternion by another's conjugate: prod = conj(lq) * rq.
 */


/*!
 * @job_class{scheduled}
 * @brief Post-multiply a quaternion by another's conjugate: prod = lq * conj(rq).
 */


/*!
 * \par<b>Assumptions and Limitations:</b>
 * - Timestamp Order or Receive Order is determined at compile time.
 */


///////////////////////////////////////////////////////////////////////////////////////////////////
/// @details  Constructs the File Search object.
///////////////////////////////////////////////////////////////////////////////////////////////////


///////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]  fileDirectory    (--) File directory to search for regular xml files.
/// @param[in]  maxNumberOfFiles (--) Max number of files to search for.
/// @details  Method to search directory. Stores found xml files in vector, ignores hidden files and
///           subdirectories.
/// @throws TsInitializationException If input data is set incorrectly.
///////////////////////////////////////////////////////////////////////////////////////////////////


///////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] pathName    (--) File name.
/// @returns   std::string (--) Returns the file extension.
/// @details   Private method used to extract out the file extension.
///////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details  Default class constructor
////////////////////////////////////////////////////////////////////////////////////////////////////


///////////////////////////////////////////////////////////////////////////////////////////////////
/// @details  Test exeption thrown when max number of files is zero.
///////////////////////////////////////////////////////////////////////////////////////////////////


///////////////////////////////////////////////////////////////////////////////////////////////////
/// @details  Test exeption thrown when file failed to load.
///////////////////////////////////////////////////////////////////////////////////////////////////


///////////////////////////////////////////////////////////////////////////////////////////////////
/// @details  Test exeption thrown when there were no files found in directory.
///////////////////////////////////////////////////////////////////////////////////////////////////


///////////////////////////////////////////////////////////////////////////////////////////////////
/// @details  Test number of files found.
///////////////////////////////////////////////////////////////////////////////////////////////////


///////////////////////////////////////////////////////////////////////////////////////////////////
/// @details  Test max number of files exception thrown.
///////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details
/// Compute the delta needed by the CppUnit CPPUNIT_ASSERT_DOUBLES_EQUAL macro based on the number
/// of significant figures the user wants to compare the expected value to the actual value.
///
/// @param[in] param    (--) The "expected" parameter passed to CPPUNIT_ASSERT_DOUBLES_EQUAL
/// @param[in] sig_figs (--) The number of non-zero significant figures the user wants to use to
///                          compare the expected with the actual
///
/// @return The delta needed for the CPPUNIT_ASSERT_DOUBLES_EQUAL
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param    queueValues  --  Input A pointer to the queue values array
/// @param    queueSize    --  Input The most recent number of values to sum
///
/// @returns  double       --  The sum of the most recent values in the queue
///
/// @details  Returns the sum of the queueSize'd most recent values in the queue array.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param    queueValues  --  Input A pointer to the queue values array
/// @param    queueSize    --  Input The most recent number of values to sum
///
/// @returns  double       --  The average of the most recent values in the queue
///
/// @throws   TsOutOfBoundsException
///
/// @details  Returns the average of the queueSize'd most recent values in the queue array.  Throws
///           an exception if the queue size is not > 0.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param    queueBools   --  Input A pointer to the queue boolean array
/// @param    queueSize    --  Input The most recent number of values to sum
///
/// @returns  bool         --  Indicates if the queue of booleans had atleast one true value
///
/// @details  Returns booleans if any of the queue array had atleast one true boolean.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details  Default constructs this Sim Bus Queue Utilities unit test.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details  Executed before each unit test as part of the CPPUNIT framework.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details  Executed after each unit test as part of the CPPUNIT framework.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details  Tests the getLatest methods
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details  Tests the getSum methods
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details  Tests the testGetAverage methods
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details  Tests the isPulseHigh methods
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param    sName   --   Name for the allocation itself
/// @param    sFrom   --   Substring to replace
/// @param    sTo     --   New substring that replaces "sFrom"
///
/// @return           --   N/A
///
/// @details  Utility function to replace invalid characters "from" to "to" in the given variable name
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param    type    --   Name of the type to be allocated
/// @param    name    --   Name for the allocation itself (optional)
/// @param    var     --   Pointer to the variable to be allocated.
///
/// @return           --   N/A
///
/// @details  Return a string containing type/name specification (e.g., "MyClass foo")
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param    str     --   Pointer to the string to be copied.
/// @param    addr_var--   Pointer to the variable to be allocated.
/// @param    name    --   Name for the allocation itself (optional).
///
/// @return           --   Pointer to the copied string.
///
/// @details  Makes a copy of the specified string.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param    str     --   Pointer to the string to be copied.
/// @param    var     --   The pointer variable that was allocated.
/// @param    addr_var--   The address of pointer variable that was allocated.
/// @param    name    --   Name for the allocation itself (optional).
///
/// @return           --   Pointer to the copied string.
///
/// @details  Declares already allocated memory to Trick and copies the specified string into that memory.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param    ptr     --   Pointer to the object to be deallocated.
/// @param    name    --   Name of type to be deallocated.
///
/// @return   void
///
/// @details  If the specified pointer is to allocated memory, it is deallocated.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details  Test for new primitive array macro.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details  Test for new primitive pointer array macro.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details  Test for string duplication macro.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details  Test for new STL object macro.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details  Test for new named STL object macro.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details  Test for new class object macro.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details  Test for new named class object macro.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details  Test for new class array macro.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details  Test for new named class array macro.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details  Test for new class array with argument constructor macro.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details  Test for new named class array with argument constructor macro.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details  Test for new class pointer array macro.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details  Test for new named class pointer array macro.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details  Test for new class multi-pointer array macro.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details  Test for is allocated macro.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]  message  (--)  The description of this exception.
/// @param[in]  thrower  (--)  The thrower (class, object or function) of this exception.
/// @param[in]  cause    (--)  The root cause of this exception.
///
/// @details    Constructor for this numerical exception used to set a message containing a
///             description or sub-type of the exception being thrown, the name of the thrower (class,
///             object or function) throwing the exception and a root cause or the physical condition
///             that resulted in the exception.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]  that  (--)  Reference to object to copy from.
///
/// @details    Copy constructs this numerical exception.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]  message  (--)  The description of this exception.
/// @param[in]  thrower  (--)  The thrower (class, object or function) of this exception.
/// @param[in]  cause    (--)  The root cause of this exception.
///
/// @details    Constructor for this invalid state transition exception used to set a message
///             containing a description or sub-type of the exception being thrown, the name of the
///             thrower (class, object or function) throwing the exception and a root cause or the
///             physical condition that resulted in the exception.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]  that  (--)  Reference to object to copy from.
///
/// @details    Copy constructs this invalid state transition exception.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]  message  (--)  The description of this exception.
/// @param[in]  thrower  (--)  The thrower (class, object or function) of this exception.
/// @param[in]  cause    (--)  The root cause of this exception.
///
/// @details    Constructor for this configuration exception used to set a message containing a
///             description or sub-type of the exception being thrown, the name of the thrower (class,
///             object or function) throwing the exception and a root cause or the physical condition
///             that resulted in the exception.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]  that  (--)  Reference to object to copy from.
///
/// @details    Copy constructs this configuration exception.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]  message  (--)  The description of this exception.
/// @param[in]  thrower  (--)  The thrower (class, object or function) of this exception.
/// @param[in]  cause    (--)  The root cause of this exception.
///
/// @details    Constructor for this out of bounds exception used to set a message containing a
///             description or sub-type of the exception being thrown, the name of the thrower (class,
///             object or function) throwing the exception and a root cause or the physical condition
///             that  resulted in the exception.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]  that  (--)  Reference to object to copy from.
///
/// @details    Copy constructs this out of bounds exception.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]  message  (--)  The description of this exception.
/// @param[in]  thrower  (--)  The thrower (class, object or function) of this exception.
/// @param[in]  cause    (--)  The root cause of this exception.
///
/// @details  Constructor for this unknown exception used to set a message containing a description
///           or sub-type of the exception being thrown, the name of the thrower (class, object or
///           function) throwing the exception and a root cause or the physical condition that
///           resulted in the exception.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]  that  (--)  Reference to object to copy from.
///
/// @details    Copy constructs this unknown exception.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]  name     (--)  The name of this exception.
/// @param[in]  message  (--)  The description of this exception.
/// @param[in]  thrower  (--)  The thrower (class, object or function) of this exception.
/// @param[in]  cause    (--)  The root cause of this exception.
///
/// @details  Constructor for this base exception used to set a message containing a description or
///           sub-type of the exception being thrown, the name of the thrower (class, object or
///           function) throwing the exception and a root cause or the physical condition that
///           resulted in the exception.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]  that  (--)  Reference to object to copy from.
///
/// @details    Copy constructs this base exception.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]  message  (--)  The description of this exception.
/// @param[in]  thrower  (--)  The thrower (class, object or function) of this exception.
/// @param[in]  cause    (--)  The root cause of this exception.
///
/// @details    Constructor for this invalid state exception used to set a message containing a
///             description or sub-type of the exception being thrown, the name of the thrower (class,
///             object or function) throwing the exception and a root cause or the physical condition
///             that resulted in the exception.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]  that  (--)  Reference to object to copy from.
///
/// @details    Copy constructs this invalid state exception.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]  message  (--)  The description of this exception.
/// @param[in]  thrower  (--)  The thrower (class, object or function) of this exception.
/// @param[in]  cause    (--)  The root cause of this exception.
///
/// @details    Constructor for this parse exception used to set a message containing a description or
///             sub-type of the exception being thrown, the name of the thrower (class, object or
///             function) throwing the exception and a root cause or the physical condition that
///             resulted in the exception.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]  that  (--)  Reference to object to copy from.
///
/// @details    Copy constructs this parse exception.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]  message  (--)  The description of this exception.
/// @param[in]  thrower  (--)  The thrower (class, object or function) of this exception.
/// @param[in]  cause    (--)  The root cause of this exception.
///
/// @details    Constructor for this initialization exception used to set a message containing a
///             description or sub-type of the exception being thrown, the name of the thrower (class,
///             object or function) throwing the exception and a root cause or the physical condition
///             that resulted in the exception.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]  that  (--)  Reference to object to copy from.
///
/// @details    Copy constructs this initialization exception.
////////////////////////////////////////////////////////////////////////////////////////////////////


/**
 *
 * This is a test method used to test the TsOutOfBoundsException
 *
 */


/**
 *
 * This is a test method used to test the TsUnknownException
 *
 */


/**
 *
 * This is a test method used to test the TsNumericalException
 *
 */


/**
 *
 * This is a test method used to test the TsConfigurationException
 *
 */


/**
 *
 * This is a test method used to test the TsParseException
 *
 */


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details  Tests the method for thowing an exception and logging simulataneously.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details A local function which returns an ISO-8601 compliant timestamp.
///
/// @param[in] unix_time  (--) A Unix time_t value produced by calling the time() function.
///
/// @return  The timestamp as a std::string.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details Constructor
///
/// @param[in] id  (--) Plugin ID.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details Configure the plugin.
///
/// @return  configData - contains the plugin configuration data.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details Initialize the text plugin. Create a new log file, if necessary.
///
/// @return  True if successful, or false if initialization failed.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details Restarts a plugin.
///
/// @return  True if successful, or false if initialization failed.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details Log a health and status message to a text file.
///
/// @param   [in] file      (--) name of file which initiated logging the message.
/// @param   [in] line      (--) line of file which initiated logging the message.
/// @param   [in] function  (--) The name of the function logging the message.
/// @param   [in] type      (--) the type of message (e.g. info, warning, etc.).
/// @param   [in] subsys    (--) the subsystem from which the message originated.
/// @param   [in] met       (--) the mission-elapsed time that the message was sent.
/// @param   [in] timestamp (--) the unix timestamp that the message was sent.
/// @param   [in] mtext     (--) the message text.
///
/// @return  True if successful, or false on failure.
///
/// @note    This method opens and closes the log file each time it logs a message. Not very
///          efficient, but perhaps more robust in multi-threaded sims - TBD?
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details Shutdown the text plugin
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details Default constructor.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details Constructor for unit testing. This ctor allows the config data to be set
//           programmatically by the unit test.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details Use configuration data to configure the logger.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details Creates the plugins using config data. Adds plugins to plugin manager and causes it
///          to init each plugin. Causes the message filter object to be initialized.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details Should be called once after all other models have initialized. Used to transition
///          some settings before going to run mode.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details Should be called once before a transition to freeze.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details Should be called periodically while in freeze.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details Should be called once before a transition from freeze to run.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details Should be called during a checkpoint restart
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details Logs a message via the plugin manager. Determines the MET time of the message.
///          Truncates the 'subsystem' field, if necessary. Forwards the message to the plugin
///          manager, if the message is not screened out by the message filter.
///
/// @param[in] file     (--) name of file which initiated logging the message.
/// @param[in] line     (--) line of file which initiated logging the message.
/// @param[in] function (--) The name of the function logging the message; typically __func__.
/// @param[in] type     (--) the type of message (e.g. info, warning, etc.).
/// @param[in] subsys   (--) the subsystem from which the message originated.
/// @param[in] mtext    (--) the message text.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details Processes messages on the message request queue.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details Processes an individual message request queue node.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details Shuts down the message manager.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details Used by test threads to log messages at random intervals.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details Constructs a SQLite plugin object given the name of a database file to generate.
///
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details Display database errors message to the console (standard error device) and close the
///          database if the error is considered fatal.
///
/// @param[in] file      (--) The file where the error occurred (unused).
/// @param[in] line      (--) The line number within the file mentioned above (unused).
/// @param[in] sql_error (--) The SQLite error message.
/// @param[in] fatal     (--) A flag used to determine if the database should be closed.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details Opens the SQLite database used for logging health and status messages. If the
///          database does not already exists, it will be created.
///
/// @return  True if the open succeeds, otherwise false.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details Opens the SQLite database and creates the database tables used for logging
///          Health and Status messages.
///
/// @return  True if the initialization succeeds, else false.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details Updates the plugin
///
/// @return  True if the update succeeds, else false.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details Commits any pending transactions and closes the database.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details Hash function used to generate database key values.
///
/// @param[in] salt  (--) (unused).
/// @param[in] str   (--) The characters of this string are used to calculate the hash value.
///
/// @return  The hash value.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details Log a health and status message to a SQLite database file.
///
/// @param[in] file      (--) name of file which initiated logging the message.
/// @param[in] line      (--) line of file which initiated logging the message.
/// @param[in] function  (--) The name of the function logging the message (unused).
/// @param[in] type      (--) the type of message (e.g. info, warning, etc.).
/// @param[in] subsys    (--) the subsystem from which the message originated.
/// @param[in] met       (--) the mission-elapsed time that the message was sent.
/// @param[in] timestamp (--) the unix timestamp that the message was sent.
/// @param[in] mtext     (--) the message text.
///
/// @return  True if successful, or false on failure.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details Log a health and status message to a SQLite database file.
///
/// @param[in] insertCommand (--) sql command to insert message into database.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details   Reinitialize the message filter after a restart. The data structure used to
///            store the message history is too complicated for trick to checkpoint. So we
///            reinitialize here by clearing the history. This means we might get a few more
///            redundant messages until the message history repopulates.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details       Removes times from the deque which precede the current interval of interest.
///
/// @param[in,out] times         (--) The deque containing times that a particular message occurred.
/// @param[in]     intervalStart (--) We are not interested in times earlier that this.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details Finds and removes the oldest message in the map.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details   Compares a message with previous ones to see the message should be suppressed or not.
///            The assumption is that the timestamp also represents the current time.
///
/// @param[in] timestamp (--) Time that message was received by filter. The MET "seconds" field
///                           of a TS_TIMER_TYPE structure which is created by the HS sim object.
/// @param[in] file      (--) Source file name invoking 'send'; typically __FILE__ macro is used.
/// @param[in] line      (--) Line in file invoking 'send'; typically __LINE__ macro is used.
/// @param[in] type      (--) Enumeration constant that represents the type of message.
/// @param[in] subsys    (--) The subsystem that is logging the message.
/// @param[in] mtext     (--) The message text.
///
/// @return    true if message should be displayed; false if message should be suppressed.
///
/// @note      The algorithm expects that in consecutive calls to this method, the value of timestamp
///            is increasing. The algorithm will not function correctly if time is moving backwards.
////////////////////////////////////////////////////////////////////////////////////////////////////


// Note: though this file implements C-style functions with C linkage (and
// therefore is named with the C naming convention), it is in fact C++


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details Constructor. Initialize filter settings to some sane values.
/// @note    Ideal filter setting are subjective and should really be set in the input file. But
///          we set some sane values to make the code work "out of the box". Setting values to
///          all zeros, doesn't make sense in this case, so just set to some arbitrary yet
///          reasonable values.
////////////////////////////////////////////////////////////////////////////////////////////////////