User's Guide
Reference Manual
Release Notes
PDF
Top

cosTime
Reference Manual
Version 1.1.12

Expand All
Contract All

Table of Contents

- cosTime
  - Top of manual page
  - install_time/0
  - uninstall_time/0
  - install_timerevent/0
  - uninstall_timerevent/0
  - start/0
  - stop/0
  - start_time_service/2
  - stop_time_service/1
  - start_timerevent_service/1
  - stop_timerevent_service/1
- CosTime_TIO
  - Top of manual page
  - '_get_time_interval'/1
  - spans/2
  - overlaps/2
  - time/1
- CosTime_TimeService
  - Top of manual page
  - universal_time/1
  - new_universal_time/4
  - uto_from_utc/2
  - new_interval/3
- CosTime_UTO
  - Top of manual page
  - '_get_time'/1
  - '_get_inaccuracy'/1
  - '_get_tdf'/1
  - '_get_utc_time'/1
  - absolute_time/1
  - compare_time/3
  - time_to_interval/2
  - interval/1
- CosTimerEvent_TimerEventHandler
  - Top of manual page
  - '_get_status'/1
  - time_set/1
  - set_timer/3
  - cancel_timer/1
  - set_data/2
- CosTimerEvent_TimerEventService
  - Top of manual page
  - register/3
  - unregister/2
  - event_time/2

# cosTime

### MODULE

cosTime

### MODULE SUMMARY

The main module of the cosTime application

### DESCRIPTION

To get access to the record definitions for the structures use:
-include_lib("cosTime/include/*.hrl").

This module contains the functions for starting and stopping the application.

This application use the time base 15 october 1582 00:00. Performing operations using other time bases will not yield correct result.

The OMG CosTime specification defines the operation secure_universal_time. As of today we cannot provide this functionality considering the criteria demanded to fulfill the OMG specification.

When using this application, time and inaccuracy supplied by the user must be given in number of 100 nano seconds. The Time Displacement Factor is positive east of the meridian, while those to the west are negative.

This application use calender:now_to_universal_time(Now) to create a UTC. Hence, the underlying OS must deliver a correct result when calling erlang:now().

When determining the inaccuracy of the system, the user should consider the way the time objects will be used. Communicating with other ORB's, add a substantial overhead and should be taken into consideration.

### EXPORTS

install_time() -> Return

Types:

Return = ok | {'EXIT', Reason}

This operation installs the cosTime Time Service part application.

uninstall_time() -> Return

Types:

Return = ok | {'EXIT', Reason}

This operation uninstalls the cosTime Time Service part application.

install_timerevent() -> Return

Types:

Return = ok | {'EXIT', Reason}

This operation installs the cosTime Timer Event Service part application.

Note

The Timer Event Service part requires Time Service part and cosEvent or the cosNotification application to be installed first.

uninstall_timerevent() -> Return

Types:

Return = ok | {'EXIT', Reason}

This operation uninstalls the cosTime Timer Event Service part application.

start() -> Return

Types:

Return = ok | {error, Reason}

This operation starts the cosTime application.

stop() -> Return

Types:

Return = ok | {error, Reason}

This operation stops the cosTime application.

start_time_service(Tdf, Inaccuracy) -> Return

Types:

Tdf = short()
Inaccuracy = ulonglong(), eq. #100 nano seconds
Return = ok | {'EXCEPTION', #'BAD_PARAM'{}}

This operation starts a Time Service server. Please note that there may only be exactly one Time Service active at a time. The Inaccuracy parameter defines the inaccuracy the underlying OS will introduce. Remember to take into account latency when passing time object between nodes.

stop_time_service(TimeService) -> ok

Types:

TimeService = #objref

This operation stops the Time Service object.

start_timerevent_service(TimeService) -> ok

Types:

TimeService = #objref

This operation starts a Timer Event Service server. Please note that there may only be exactly one Timer Event Service per node active at a time. The supplied TimeServcie reference will be the object Timer Event Service contacts to get access to a new UTC.

stop_timerevent_service(TimerEventService) -> ok

Types:

TimerEventService = #objref

This operation stops the Timer Event Service object.