NumCpp  2.12.1
A Templatized Header Only C++ Implementation of the Python NumPy Library
nc::logger::detail::BinaryDataLogger< DataType > Class Template Reference

Binary Logger. More...

#include <BinaryLogger.hpp>

Public Types

using const_pointer = const DataType *const
 
using const_reference = const DataType &
 
using value_type = DataType
 

Public Member Functions

 BinaryDataLogger ()
 Default constructor. More...
 
 BinaryDataLogger (BinaryDataLogger &&)=delete
 
 BinaryDataLogger (const BinaryDataLogger &)=delete
 
 BinaryDataLogger (std::filesystem::path outputDir)
 Constructor. More...
 
 BinaryDataLogger (std::string_view outputDir)
 Constructor. More...
 
 ~BinaryDataLogger ()
 Destructor. More...
 
void disable () noexcept
 Disable the logger. More...
 
void enable () noexcept
 Enable the logger. More...
 
const std::filesystem::path & filepath () const noexcept
 The log file path. More...
 
void flush ()
 Force a flush of the output stream. More...
 
bool isEnabled () noexcept
 Checks whether logger is enabled. More...
 
void log (const_pointer dataElements, std::size_t numElements)
 Logs the data elements. More...
 
void log (const_reference dataElement)
 Logs the data element. More...
 
BinaryDataLoggeroperator= (BinaryDataLogger &&)=delete
 
BinaryDataLoggeroperator= (const BinaryDataLogger &)=delete
 
void setOutputDir (std::filesystem::path outputDir)
 Sets the output log directory. More...
 
void setOutputDir (std::string_view outputDir)
 Sets the output log directory. More...
 

Static Public Attributes

static constexpr auto DATA_ELEMENT_SIZE = sizeof(value_type)
 
static constexpr auto DATE_TYPE_HAS_SERIALIZE_METHOD = type_traits::has_serialize_v<value_type>
 
static constexpr char LOG_EXT [] = ".log"
 

Detailed Description

template<typename DataType>
class nc::logger::detail::BinaryDataLogger< DataType >

Binary Logger.

Member Typedef Documentation

◆ const_pointer

template<typename DataType >
using nc::logger::detail::BinaryDataLogger< DataType >::const_pointer = const DataType* const

◆ const_reference

template<typename DataType >
using nc::logger::detail::BinaryDataLogger< DataType >::const_reference = const DataType&

◆ value_type

template<typename DataType >
using nc::logger::detail::BinaryDataLogger< DataType >::value_type = DataType

Constructor & Destructor Documentation

◆ BinaryDataLogger() [1/5]

template<typename DataType >
nc::logger::detail::BinaryDataLogger< DataType >::BinaryDataLogger ( )
inline

Default constructor.

◆ BinaryDataLogger() [2/5]

template<typename DataType >
nc::logger::detail::BinaryDataLogger< DataType >::BinaryDataLogger ( std::filesystem::path  outputDir)
inlineexplicit

Constructor.

Parameters
outputDirthe directory to place the output log

◆ BinaryDataLogger() [3/5]

template<typename DataType >
nc::logger::detail::BinaryDataLogger< DataType >::BinaryDataLogger ( std::string_view  outputDir)
inlineexplicit

Constructor.

Parameters
outputDirthe directory to place the output log

◆ ~BinaryDataLogger()

template<typename DataType >
nc::logger::detail::BinaryDataLogger< DataType >::~BinaryDataLogger ( )
inline

Destructor.

◆ BinaryDataLogger() [4/5]

template<typename DataType >
nc::logger::detail::BinaryDataLogger< DataType >::BinaryDataLogger ( const BinaryDataLogger< DataType > &  )
delete

◆ BinaryDataLogger() [5/5]

template<typename DataType >
nc::logger::detail::BinaryDataLogger< DataType >::BinaryDataLogger ( BinaryDataLogger< DataType > &&  )
delete

Member Function Documentation

◆ disable()

template<typename DataType >
void nc::logger::detail::BinaryDataLogger< DataType >::disable ( )
inlinenoexcept

Disable the logger.

◆ enable()

template<typename DataType >
void nc::logger::detail::BinaryDataLogger< DataType >::enable ( )
inlinenoexcept

Enable the logger.

◆ filepath()

template<typename DataType >
const std::filesystem::path & nc::logger::detail::BinaryDataLogger< DataType >::filepath ( ) const
inlinenoexcept

The log file path.

◆ flush()

template<typename DataType >
void nc::logger::detail::BinaryDataLogger< DataType >::flush ( )
inline

Force a flush of the output stream.

◆ isEnabled()

template<typename DataType >
bool nc::logger::detail::BinaryDataLogger< DataType >::isEnabled ( )
inlinenoexcept

Checks whether logger is enabled.

◆ log() [1/2]

template<typename DataType >
void nc::logger::detail::BinaryDataLogger< DataType >::log ( const_pointer  dataElements,
std::size_t  numElements 
)
inline

Logs the data elements.

Parameters
dataElementsthe data element pointer
numElementsthe number of data elements to log

◆ log() [2/2]

template<typename DataType >
void nc::logger::detail::BinaryDataLogger< DataType >::log ( const_reference  dataElement)
inline

Logs the data element.

Parameters
dataElementthe data element

◆ operator=() [1/2]

template<typename DataType >
BinaryDataLogger & nc::logger::detail::BinaryDataLogger< DataType >::operator= ( BinaryDataLogger< DataType > &&  )
delete

◆ operator=() [2/2]

template<typename DataType >
BinaryDataLogger & nc::logger::detail::BinaryDataLogger< DataType >::operator= ( const BinaryDataLogger< DataType > &  )
delete

◆ setOutputDir() [1/2]

template<typename DataType >
void nc::logger::detail::BinaryDataLogger< DataType >::setOutputDir ( std::filesystem::path  outputDir)
inline

Sets the output log directory.

Parameters
outputDirthe output directory

◆ setOutputDir() [2/2]

template<typename DataType >
void nc::logger::detail::BinaryDataLogger< DataType >::setOutputDir ( std::string_view  outputDir)
inline

Sets the output log directory.

Parameters
outputDirthe output directory

Field Documentation

◆ DATA_ELEMENT_SIZE

template<typename DataType >
constexpr auto nc::logger::detail::BinaryDataLogger< DataType >::DATA_ELEMENT_SIZE = sizeof(value_type)
staticconstexpr

◆ DATE_TYPE_HAS_SERIALIZE_METHOD

template<typename DataType >
constexpr auto nc::logger::detail::BinaryDataLogger< DataType >::DATE_TYPE_HAS_SERIALIZE_METHOD = type_traits::has_serialize_v<value_type>
staticconstexpr

◆ LOG_EXT

template<typename DataType >
constexpr char nc::logger::detail::BinaryDataLogger< DataType >::LOG_EXT[] = ".log"
staticconstexpr

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