21#ifndef ARCHITECTURE_TIME_H
22#define ARCHITECTURE_TIME_H
24#include "configuration.h"
27#if CLOCKWERK_ALLOW_STD_STRING
35#define NSEC_MAX 999999999
91 int16
str(
char* output,
size_t size)
const override;
93#if CLOCKWERK_ALLOW_STD_STRING
94#if CLOCKWERK_ALLOW_VECTOR
98 int16 log(
void* logger) {
99 SimLogger* log_ptr = (SimLogger*)logger;
106 std::vector<std::string> header_info()
const {
148 int16
divide(
unsigned int d,
Time &res)
const;
bool _loggable
Variable to indicate whether the selected object is loggable. Set to false by default.
Definition GraphTreeObject.h:273
GraphTreeObject(const char *gt_nme="", GraphTreeObject **storage_array=nullptr, uint32 storage_size=0)
Name-based constructor for GraphTreeObject which will have no children by default.
Definition GraphTreeObject.cpp:23
void setTime(const struct timespec &t)
Function to set the time in the time object.
Definition Time.h:67
floating_point asFloatingPoint() const
Definition Time.h:80
struct timespec _tspec
Definition Time.h:175
bool operator<=(const Time &B) const
Overloaded operator to compare two time objects.
Definition Time.cpp:200
int16 multiply(unsigned int m, Time &res) const
Function to multiply time by int.
Definition Time.cpp:128
Time(const struct timespec &t)
Default, copy constructors and default destructor.
Definition Time.h:56
int16 subtract(const Time &b, Time &res) const
Function to subtract a - b = res.
Definition Time.cpp:102
bool operator==(const Time &B) const
Overloaded operator to compare two time objects.
Definition Time.cpp:214
int16 add(const Time &a, Time &res) const
Set the time object from a string.
Definition Time.cpp:87
~Time()
Definition Time.h:58
bool operator>(const Time &B) const
Overloaded operator to compare two time objects.
Definition Time.cpp:158
void fromFloatingPoint(floating_point val)
Function to set a time object from floating point.
Definition Time.cpp:63
Time(int64 sec=0, int64 nsec=0)
Definition Time.h:57
floating_point asFrequency()
Function to convert time to frequency in Hz.
Definition Time.cpp:36
int64 nsec() const
Get time nanoseconds.
Definition Time.h:63
const timespec & asTimespec() const
Functions to return various time formats.
Definition Time.h:79
bool operator<(const Time &B) const
Overloaded operator to compare two time objects.
Definition Time.cpp:172
int16 fromStr(const char *str) override
Definition Time.cpp:78
void stepTime(uint64 nsec)
Function to step time forward by a set amount of nanoseconds.
Definition Time.cpp:24
void setTime(uint32 sec, uint32 nsec)
Function to set the time in the time object.
Definition Time.h:72
int16 str(char *output, size_t size) const override
Output time as string.
Definition Time.cpp:74
int16 fromFrequency(uint16 rate_hz)
Function to set a time object from a frequency, in Hz.
Definition Time.cpp:44
bool operator>=(const Time &B) const
Overloaded operator to compare two time objects.
Definition Time.cpp:186
unsigned long long asMilliseconds() const
Definition Time.h:81
int64 sec() const
Get time seconds.
Definition Time.h:61
int16 divide(unsigned int d, Time &res) const
Function to divide time by int.
Definition Time.cpp:141
#define NO_ERROR
Error code in the case where matrix math executed successfully.
Definition clockwerkerrors.h:34
Definition CircularBuffer.hpp:28
const uint32 NSEC_PER_SEC_I
Definition Time.h:41
const floating_point NSEC_PER_SEC_D
Definition Time.h:38
const uint32 NSEC_PER_MSEC_I
Definition Time.h:40
const uint16 MSEC_PER_SEC_I
Definition Time.h:39