本文整理汇总了C++中argument_type::exec方法的典型用法代码示例。如果您正苦于以下问题:C++ argument_type::exec方法的具体用法?C++ argument_type::exec怎么用?C++ argument_type::exec使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类argument_type
的用法示例。
在下文中一共展示了argument_type::exec方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: wciTimeSpec
void
LocationPointRead::
operator () ( argument_type &t )
{
ostringstream q;
boost::posix_time::ptime refTime;
string validTime;
bool disabled;
int dataversion;
WEBFW_USE_LOGGER( "wdb" );
if( to_.is_special() )
validTime = "NULL";
else
validTime = wciTimeSpec( wciProtocol_,
boost::posix_time::ptime( boost::posix_time::neg_infin), to_ );
for( ParamDefList::const_iterator itPar=paramDefs_.begin();
itPar != paramDefs_.end();
++itPar )
{
if( ! refTimeList_.providerReftimeDisabledAndDataversion(itPar->first,
refTime,
disabled,
dataversion ) ) {
WEBFW_LOG_WARN("No reference times found for provider '" << itPar->first << "'." <<
"Check that the provider is listed in provider_priority.");
continue;
}
if( disabled ) {
WEBFW_LOG_WARN("Provider '" << itPar->first << "' disabled." );
continue;
}
if( dataversion < -1 )
dataversion = -1;
q.str("");
q << "SELECT " << wciReadReturnColoumns( wciProtocol_ ) << " FROM wci.read(" << endl
<< "ARRAY['" << itPar->first << "'], " << endl
<< "'nearest POINT(" << longitude_ << " " << latitude_ << ")', " << endl
<< wciTimeSpec( wciProtocol_, refTime ) << ", " << endl
<< validTime << ", " << endl
<< wciValueParameter( wciProtocol_, itPar->second ) << ", " << endl
<< "NULL, " << endl
<< "ARRAY[" << dataversion << "], NULL::wci.returnfloat ) ORDER BY referencetime";
WEBFW_LOG_DEBUG( "LocationPointRead: transactor: SQL [" << q.str() << "]" );
pqxx::result res = t.exec( q.str() );
//miutil::container::PqContainer container( res );
decodePData( paramDefs_, providers_, refTimeList_, res, false, *locationPointData_, wciProtocol_ );
}
}
示例2: myDataversion
void
LocationPointMatrixData::
operator () ( argument_type &t )
{
ostringstream q;
string sSurround;
boost::posix_time::ptime validtimeto;
boost::posix_time::ptime validtimefrom;
boost::posix_time::ptime prevValidTimeTo;
boost::posix_time::ptime prevValidTimeFrom;
ParamDefPtr itPar;
LocationPoint locationPoint;
string dummyGroupProvider;
int expextNValues=1;
int nValues=0;
int n=1;
float value;
int x=0;
int y=0;
int myDataversion( dataversion_ );
WEBFW_USE_LOGGER( logger_ );
locations_->clear();
query_->clear();
if( surroundLevel_ < 0 ) {
WEBFW_LOG_WARN("The SUROUND level is less than 0, setting it to 0.");
surroundLevel_ = 0;
}
if( wciProtocol_ < 6) {
sSurround ="SURROUND ";
expextNValues = 4;
n=2;
} else {
if( surroundLevel_ > 0 ) {
n = 2*surroundLevel_;
expextNValues = 4*surroundLevel_*surroundLevel_; // (2*surroundLevel_)^2
q << "SURROUND(" << surroundLevel_ << ") ";
sSurround = q.str();
// n=surroundLevel_;
}
}
LocationPointMatrix pointMatrix( n, n );
LocationPointMatrix undefPointMatrix( n, n );
for( int x=0; x<n; ++x)
for( int y=0; y<n; ++y )
undefPointMatrix[x][y] = LocationPoint();
if( myDataversion < -1 )
myDataversion = -1;
q.str("");
q << "SELECT " << wciReadReturnColoumns( wciProtocol_ ) << " FROM wci.read(" << endl
<< "ARRAY['" << provider_ << "'], " << endl
<< "'" << sSurround << "POINT(" << longitude_ << " " << latitude_ << ")', " << endl
<< wciTimeSpec( wciProtocol_, reftimespec_ ) << ", " << endl
<< "NULL, " << endl
<< "ARRAY['" << paramDef_.valueparametername() << "'], " << endl
<< wciLevelSpec( wciProtocol_, paramDef_ ) << ", " << endl
<< "ARRAY[" << myDataversion << "], NULL::wci.returnfloat ) ORDER BY referencetime, validtimeto, validtimefrom";
WEBFW_LOG_DEBUG( "LocationPointMatrixData: transactor: SQL [" << q.str() << "]" );
*query_ = q.str();
pqxx::result res = t.exec( q.str() );
for( pqxx::result::const_iterator it=res.begin(); it != res.end(); ++it ) {
if( it.at("value").is_null() )
continue;
if( params_.findParam( it, itPar, dummyGroupProvider ) ) {
if( !LocationPoint::decodeGisPoint( it.at("point").c_str(), locationPoint ) )
continue;
validtimefrom = miutil::ptimeFromIsoString( it.at("validtimefrom").c_str() );
validtimeto = miutil::ptimeFromIsoString( it.at("validtimeto").c_str() );
if( prevValidTimeTo.is_special() ) {
prevValidTimeTo = validtimeto;
prevValidTimeFrom = validtimefrom;
} else if( prevValidTimeTo != validtimeto ) {
if( nValues != expextNValues ) {
WEBFW_LOG_DEBUG("LocationPointMatrixData: expected: " << expextNValues << ", but got " << nValues << ".");
}
if( WEBFW_GET_LOGLEVEL() == log4cpp::Priority::DEBUG ) {
ostringstream ost;
ost << "LocationPointMatrixData: " << prevValidTimeFrom << " - " << prevValidTimeTo;
for( int x=0; x<n; ++x)
for( int y=0; y<n; ++y )
ost << "\n [" << x << ", " << y <<"] = " << pointMatrix[x][y].value();
WEBFW_LOG_DEBUG( ost.str() );
}
locations_->insert( prevValidTimeFrom, prevValidTimeTo, pointMatrix, false );
//.........这里部分代码省略.........