当前位置: 首页>>代码示例>>C++>>正文


C++ TimeStamp::AsString方法代码示例

本文整理汇总了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");
}
开发者ID:chenbk85,项目名称:CuteTestForCoastTest,代码行数:21,代码来源:SybCTnewDAImpl.cpp

示例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;
}
开发者ID:chenbk85,项目名称:CuteTestForCoastTest,代码行数:40,代码来源:SybCTnewDAImpl.cpp


注:本文中的TimeStamp::AsString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。