本文整理汇总了C++中TimeStamp::AsString方法的典型用法代码示例。如果您正苦于以下问题:C++ TimeStamp::AsString方法的具体用法?C++ TimeStamp::AsString怎么用?C++ TimeStamp::AsString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TimeStamp
的用法示例。
在下文中一共展示了TimeStamp::AsString方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: IntDoPutbackConnection
void SybCTnewDAImpl::IntDoPutbackConnection(SybCTnewDA *&pSyb, bool bIsOpen, const String &server, const String &user)
{
StartTrace1(SybCTnewDAImpl.IntDoPutbackConnection, "putting &" << (long)(IFAObject *)pSyb);
if ( bIsOpen ) {
String strToStore(server);
strToStore << '.' << user;
TimeStamp aStamp;
Anything anyTimeStamp(coast::storage::Global());
if ( !fgListOfSybCT.LookupPath(anyTimeStamp, "Open") ) {
anyTimeStamp = Anything(Anything::ArrayMarker(),coast::storage::Global());
fgListOfSybCT["Open"] = anyTimeStamp;
}
Anything anyToStore(coast::storage::Global());
anyToStore[0L] = (IFAObject *)pSyb;
anyToStore[1L] = strToStore;
anyTimeStamp[aStamp.AsString()].Append(anyToStore);
} else {
fgListOfSybCT["Unused"].Append((IFAObject *)pSyb);
}
TraceAny(fgListOfSybCT, "current list of connections");
}
示例2: CheckCloseOpenedConnections
bool SybCTnewDAImpl::CheckCloseOpenedConnections(long lTimeout)
{
StartTrace(SybCTnewDAImpl.CheckCloseOpenedConnections);
bool bRet = false;
Anything anyTimeStamp(coast::storage::Global());
TimeStamp aStamp;
aStamp -= lTimeout;
Trace("current timeout " << lTimeout << "s, resulting time [" << aStamp.AsString() << "]");
LockUnlockEntry me(fgStructureMutex);
if ( fgInitialized ) {
TraceAny(fgListOfSybCT, "current list of connections");
if ( fgListOfSybCT.LookupPath(anyTimeStamp, "Open") && anyTimeStamp.GetSize() ) {
SybCTnewDA *pSyb = NULL;
long lTS = 0L;
// if we still have open connections and the last access is older than lTimeout seconds
while ( anyTimeStamp.GetSize() && ( aStamp > TimeStamp(anyTimeStamp.SlotName(lTS)) ) ) {
Anything anyTS(coast::storage::Global());
anyTS = anyTimeStamp[lTS];
TraceAny(anyTS, "stamp of connections to close [" << anyTimeStamp.SlotName(0L) << "]");
while ( anyTS.GetSize() ) {
pSyb = SafeCast(anyTS[0L][0L].AsIFAObject(), SybCTnewDA);
anyTS.Remove(0L);
if ( pSyb != NULL ) {
Trace("closing timeouted connection");
if ( pSyb->Close() ) {
bRet = true;
}
} else {
SYSWARNING("Sybase connection with address " << (long)pSyb << " not valid anymore!");
}
fgListOfSybCT["Unused"].Append((IFAObject *)pSyb);
}
anyTimeStamp.Remove(lTS);
}
}
} else {
SYSERROR("SybCTnewDAImpl not initialized!");
}
return bRet;
}