You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by "Gordon Sim (JIRA)" <ji...@apache.org> on 2011/02/24 12:22:38 UTC

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

     [ https://issues.apache.org/jira/browse/QPID-2362?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gordon Sim resolved QPID-2362.
------------------------------

    Resolution: Not A Problem

The (latest) doxygen for qpid/sys/Time.h recommends :

int64_t nanosec_since_epoch = Duration(EPOCH, now());

which you could then get back to an AbsTime by:

AbsTime myTime(EPOCH, nanosec_since_epoch);

(If this doesn't address the issue, feel free to reopen with details).

> 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.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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