24 #ifndef Safir_Databases_Odbc_Columns_h
25 #define Safir_Databases_Odbc_Columns_h
27 #ifndef SAFIR_NO_DEPRECATED
30 #include "Safir/Databases/Odbc/Internal/InternalDefs.h"
31 #include "Safir/Databases/Odbc/Internal/Column.h"
32 #include "Safir/Databases/Odbc/Internal/BinaryColumn.h"
33 #include "Safir/Databases/Odbc/Internal/WideStringColumn.h"
36 #include <boost/date_time/posix_time/posix_time.hpp>
57 class TimeColumn :
public Internal::Column<SQL_C_TYPE_TIMESTAMP, TIMESTAMP_STRUCT>
67 typedef Internal::Column<SQL_C_TYPE_TIMESTAMP, TIMESTAMP_STRUCT> InstantiatedColumn;
74 typedef Internal::Column<SQL_C_FLOAT, Safir::Dob::Typesystem::Float32>
Float32Column;
76 typedef Internal::Column<SQL_C_DOUBLE, Safir::Dob::Typesystem::Float64>
Float64Column;
78 typedef Internal::Column<SQL_C_SLONG, Safir::Dob::Typesystem::Int32>
Int32Column;
80 typedef Internal::Column<SQL_C_SBIGINT, Safir::Dob::Typesystem::Int64>
Int64Column;
88 Internal::Column<SQL_C_BIT, unsigned char>::SetValue(bValue ? 1 : 0);
93 return Internal::Column<SQL_C_BIT, unsigned char>::GetValue() == 1;
102 InstantiatedColumn::SetValue( tsTime );
107 boost::posix_time::ptime pTime;
108 TIMESTAMP_STRUCT value;
111 value.year =
static_cast<SQLSMALLINT
>(pTime.date().year());
112 value.month =
static_cast<SQLUSMALLINT
>(pTime.date().month());
113 value.day =
static_cast<SQLUSMALLINT
>(pTime.date().day());
114 value.hour =
static_cast<SQLUSMALLINT
>(pTime.time_of_day().hours());
115 value.minute =
static_cast<SQLUSMALLINT
>(pTime.time_of_day().minutes());
116 value.second =
static_cast<SQLUSMALLINT
>(pTime.time_of_day().seconds());
117 value.fraction =
static_cast<SQLUINTEGER
>(pTime.time_of_day().fractional_seconds());
118 InstantiatedColumn::SetValue( value );
123 return InstantiatedColumn::GetValue();
128 return InstantiatedColumn::GetValue();
133 boost::gregorian::date pDate(m_value.year, m_value.month, m_value.day);
134 boost::posix_time::time_duration pTimeDuration(m_value.hour, m_value.minute, m_value.second, m_value.fraction);
135 boost::posix_time::ptime pTime(pDate, pTimeDuration);
148 #endif // Safir_Databases_Odbc_Columns_h
static boost::posix_time::ptime ToPtime(const Safir::Dob::Typesystem::Si64::Second utcTime)
Get specified UTC time in boost::posix_time::ptime representation.
Internal::Column< SQL_C_DOUBLE, Safir::Dob::Typesystem::Float64 > Float64Column
Definition: Columns.h:76
This namespace contains all the functionality and definitions of the SAFIR SDK.
Definition: Backdoor.h:30
Internal::Column< SQL_C_SLONG, Safir::Dob::Typesystem::Int32 > Int32Column
Definition: Columns.h:78
static Safir::Dob::Typesystem::Si64::Second ToDouble(const boost::posix_time::ptime &utcTime)
Convert specified UTC time to a Double.
const TIMESTAMP_STRUCT & GetTimeStamp() const
Definition: Columns.h:121
Internal::BinaryColumn BinaryColumn
Definition: Columns.h:70
Float64 Second
64 bit representation of Second.
Definition: Defs.h:197
Internal::Column< SQL_C_SBIGINT, Safir::Dob::Typesystem::Int64 > Int64Column
Definition: Columns.h:80
void SetTimeStamp(const TIMESTAMP_STRUCT &tsTime)
Definition: Columns.h:100
Internal::Column< SQL_C_FLOAT, Safir::Dob::Typesystem::Float32 > Float32Column
Definition: Columns.h:74
Internal::WideStringColumn WideStringColumn
Definition: Columns.h:72
bool GetValue() const
Definition: Columns.h:91
void SetValue(bool bValue)
Definition: Columns.h:86
void SetValue(Safir::Dob::Typesystem::Si64::Second time)
Definition: Columns.h:105
void GetValue(Safir::Dob::Typesystem::Si64::Second &time) const
Definition: Columns.h:131