Exemplo n.º 1
0
PEGASUS_NAMESPACE_BEGIN

String Guid::getGuid(const String &prefix)
{
  Uint32 seconds(0), milliSeconds(0);
  System::getCurrentTime(seconds, milliSeconds);
  CIMValue secondsValue(seconds);
  CIMValue milliSecondsValue(milliSeconds);
  String ipAddress;
  String hostName(System::getHostName());
  if ((ipAddress = System::getHostIP(hostName)) == String::EMPTY)
  {
      // set default address if everything else failed
      ipAddress = String("127.0.0.1");
  }
  // change the dots to dashes
  for (Uint32 i=0; i<ipAddress.size(); i++)
    {
      if (ipAddress[i] == Char16('.'))
        ipAddress[i] = Char16('-');
    }

  return (secondsValue.toString() + milliSecondsValue.toString() + "-" + ipAddress);
}
Exemplo n.º 2
0
 int32_t TimeBase::MilliSeconds() const
 {
   return milliSeconds();
 }
Exemplo n.º 3
0
		dateTime();																	// base class features

		dateTime(const ptime & pt) : ptime(pt) {};									// build from ptime

		dateTime(years, months, days,												// additional Constructor
			time_duration

#ifdef BOOST_DATE_TIME_HAS_NANOSECONDS
			= nanoSeconds(0));
#else
			= microSeconds(0));
#endif

		dateTime(years, months , days   , 
				 hours, minutes, seconds, 
				 milliSeconds = milliSeconds(0),									// additional Constructor
				 microSeconds = microSeconds(0)
#ifdef BOOST_DATE_TIME_HAS_NANOSECONDS
				 , nanoSeconds = naoseconds(0)
#endif
				 );

		dateTime & operator=(const dateTime &);
		
		virtual ~dateTime();														// destructor

		years        year        () const;											// accessors
		months       month       () const;
		days         day         () const;
		hours        hour        () const;
		minutes      minute      () const;