Exemple #1
0
SNORTRULEHDR CRuleOption* CPcreOption::Clone() const
{
	CPcreOption *pNew = null;
	try
	{
		pNew = new CPcreOption(*this);
	}
	catch (std::exception &e)
	{
		throw CTrace(__FILE__, __LINE__, e.what());
	}
	return pNew;
}
Exemple #2
0
   CTraceFn::~CTraceFn()
   {
      CMutexLocker locker( CTraceFn::_mutex );
      
      unsigned long callTimeDiff( CTraceFn::CallTime() - _callTime );
      unsigned long long threadTimeDiff( CTraceFn::ThreadTime() - _threadTime );

      CProfiler::GetInstance()->RegisterFunction( _name, callTimeDiff, threadTimeDiff );

      if( _isShow )
      {
         --CTraceFn::_dept;

         std::string spaces( CTraceFn::_dept * 3, ' ' );

         CTrace( _file, _line ).impl() << "TraceFn: " << spaces << _name << " | R" << std::endl;
      }
   }
Exemple #3
0
   CTraceFn::CTraceFn( ETraceLevel aLevel, const std::string& aName,
                                           const std::string aFile,
                                           unsigned int aLine )
   {
      CMutexLocker locker( CTraceFn::_mutex );

      _name = aName;
      _file = aFile;
      _line = aLine;

      _isShow = CTrace::IsLevelMatch( aLevel );

      if( _isShow )
      {
         std::string spaces( CTraceFn::_dept * 3, ' ' );

         CTrace( _file, _line ).impl() << "TraceFn: " << spaces << _name << " | C" << std::endl;

         ++CTraceFn::_dept;
      }
      
      _callTime = CTraceFn::CallTime();
      _threadTime = CTraceFn::ThreadTime();
   }