Synchronization in NMM

Motama GmbH, Saarbruecken, Germany

http://www.motama.com

April 2007

  Copyright (C) 2007,
  Motama GmbH, Saarbruecken, Germany
  http://www.motama.com
 
  Permission is granted to copy, distribute and/or modify this
  document under the terms of the GNU Free Documentation License,
  Version 1.2 or any later version published by the Free Software
  Foundation; with the Invariant Sections being all sections, no
  Front-Cover Texts, and no Back-Cover Texts. A copy of the license
  can be found in the file COPYING.FDL.

  THE DOCUMENT IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
  NON-INFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR ANYONE
  DISTRIBUTING THE DOCUMENT BE LIABLE FOR ANY DAMAGES OR OTHER
  LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT
  OF OR IN CONNECTION WITH THE DOCUMENT OR THE USE OR OTHER DEALINGS
  IN THE DOCUMENT.


Table of Contents
1. Time Representation - Time and Interval
2. How to get the Time - Clock and TimedElement
3. Time Information in the Data Stream - Timestamp
4. How to create Timestamps - StreamTimer
5. Sink Nodes - GenericSyncSinkNode
6. Events related to Synchronization
7. Synchronization in the Application Code

1. Time Representation - Time and Interval

There are two types for representation of time in NMM. Time represents a point of time, Interval stands for a duration (which can be considered as the difference between two points of time.) Both Time and Interval have a precision of one nanosecond. They are internally stored as

  struct Time {                    struct Interval {
    long int sec;                    long int sec;
    long int nsec;                   long int nsec;
  };                               };
	
Since a set of standard operators comes along with the two types, and so it should not be necessary to manipulate them at that low level. There is also a type for a human readable time representation, UserTime.
  struct UserTime {
    int hour;
    int min;
    int sec;
    int msec;
  };