1 #ifndef CARMA_DBMS_NUMERICFILTER_H
2 #define CARMA_DBMS_NUMERICFILTER_H
21 #include "carma/util/compileTimeCheck.h"
33 template <
typename T >
48 GREATER_THAN_OR_EQUAL_TO,
86 toString( const ::std::string & tableName =
"",
87 const ::std::string & columnName =
"" )
const;
93 virtual ::std::string
name( )
const;
105 template<
typename T >
109 searchType_(searchType ) {
113 util::compileTimeCheck< ::std::numeric_limits< T >::is_specialized >( );
117 template<
typename T >
122 template<
typename T >
129 template<
typename T >
136 template<
typename T >
139 const ::std::string & tableName,
140 const ::std::string & columnName )
const
142 ::std::ostringstream ss;
144 ss << fullyQualifiedColumnName_( tableName, columnName );
146 switch ( searchType_ ) {
147 case GREATER_THAN: ss <<
" > ";
break;
148 case GREATER_THAN_OR_EQUAL_TO: ss <<
" >= ";
break;
149 case EQUAL_TO: ss <<
" = ";
break;
150 case LESS_THAN: ss <<
" < ";
break;
151 case LESS_THAN_OR_EQUAL_TO: ss <<
" <= ";
break;
155 ::std::stringstream emsg;
156 emsg <<
"Unhandled searchType value " << searchType_;
168 template<
typename T >
171 return "NumericFilter<>";
SearchType
type of test to perform
abstract base class to represent an SQL query one component filter (part of a WHERE clause) ...
T getValue() const
return the test value
abstract base class to represent a simple one component filter
SearchType getSearchType() const
return the search type
virtual ::std::string toString(const ::std::string &tableName="", const ::std::string &columnName="") const
string representation of the filter.
header that defines a number of common exceptions by including their header files.
virtual ~NumericFilter()
destructor, derived classes may want to override
virtual ::std::string name() const
get the class name for log messages etc.
NumericFilter(T value, SearchType searchType)
constuctor
#define CARMA_ERROR(y)
Trick to get the file name and line number passed to the exception handler.
template to represent a one component numeric search filter.