You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by "Kerry Bonin (JIRA)" <qp...@incubator.apache.org> on 2010/01/26 20:30:34 UTC

[jira] Created: (QPID-2362) No clear way to read an AbsTime from a Variant...

No clear way to read an AbsTime from a Variant...
-------------------------------------------------

                 Key: QPID-2362
                 URL: https://issues.apache.org/jira/browse/QPID-2362
             Project: Qpid
          Issue Type: Bug
          Components: C++ Client
    Affects Versions: 0.5
         Environment: C++
            Reporter: Kerry Bonin


I'm working on sending and receiving a timestamp of type qpid::sys::AbsTime via qpid::messaging::MapContent.

The instructions in qpid\sys\Time.h recommend use of the Duration class for access to the ns value, leading to this example:
  Message msgOut;
  MapContent contentOut( msgOut );
  contentOut[ "timestamp" ] = Variant( Duration( AbsTime::now() ) );

This works fine (other than the epoch bug [QPID-1904] on Windows I just submitted a patch for.)

The problem is, how do I get the AbsTime back out of the map?  I can extract the int64_t value just fine, but there are no appropriate AbsTime constructors.  The only exposed methods are now() and the (const AbsTime & t, const Duration & d) constructor, but since the default constructor for AbsTime initializes to a 'not-a-date-time' state, there does not appear to be a valid way to initialize AbsTime from a specific value.

One suggestion would be to add an AbsTime constructor that takes an int64_t ns parameter in the Jan 1, 1970 epoch.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org