ColdFrame: Specially written support components

This page discusses full ColdFrame, which supports various testing facilities as well as being customisable to user requirements.

The restricted Ravenscar profile offers far less customisability, and isn't intended to support testing directly. Instead, the idea is that the model and code are tested on the desktop, and then the model is regenerated for delivery on the target platform (with its implementation unaltered).

Library components

Specially written support components appear under the top-level package ColdFrame. The more user-interesting ones are

Provides callback (Observer) support.

Standard support for Events. This is a basic generic event management specification; the time aspects are provided using ColdFrame.Time_Signature.
Logging expects ColdFrame.Project.Log_Error and ColdFrame.Project.Log_Info.
Events are based on an abstract basis type; the "no-frills" version is in ColdFrame.Events_Basis, while the version in ColdFrame.Logging_Events_Basis captures statistics on the time for which events are queued and on the time taken to handle each event.
Child packages are

Provides a "creation" event type, for use where there's no application event to cause transition from the initial state.

A straightforward event queueing and dispatching service.

Adds unit test support to a concrete ColdFrame.Events_G.Event_Queue. The additional features are
  • inspection of Timers; is a timer set, when would it expire?
  • the event queue doesn't start until told (provided that this decoration is added last).

Adds logging (via ColdFrame.Project.Logging_Support) to a concrete ColdFrame.Events_G.Event_Queue.

Provides exceptions.

Provides exception reporting (to standard output).

Enables GNAT's exception traceback facility, which is set up to report unhandled exceptions both in the main program and in tasks. To use it (only in Linux and Windows host-is-target environments; won't work in Mac OS X or VxWorks), you must
  1. with this package,
  2. give the switch -E to the binder.

Enables GNAT's exception traceback facility, which is set up to report unhandled exceptions both in the main program and in tasks.
This version produces the traceback in hexadecimal form; use addr2line (or, on Mac OS X, atos) to convert to a readable form.
To use it, you must
  1. with this package,
  2. give the switch -E to the binder.

A family of hash functions, suitable for use as hashes (or part of hashes) for instantiating Hashed Map or Set containers.

A hash function for access values (useful for associative classes).

A hash function for access-to-instance values (useful for child classes).

A family of hash functions for strings.

A hash function for Bounded Strings.

A hash function for standard Strings.

A hash function for Unbounded Strings.

Provides a type from which all Instances are derived.
The purpose is to allow mutual visibility (to support associations and inheritance relationships) without using non-standard extensions such as WITH TYPE.

Provides support for (simple) interrupt handling.

Provides a facility for deleting the task associated with an active instance when it has in fact terminated.

Supplied Project components

For some purposes, ColdFrame generates code expecting certain services to be provided by specific packages (under ColdFrame.Project), where you would probably prefer to be able to provide your own version.

In these cases, sample implementations are provided. The support code above is distributed in the directory cf-yyyymmdd/lib, while the sample project code below is under cf-yyyymmdd/project.

ColdFrame.Project.Calendar.Time is used as the translation for Date, Time attributes.
The provided default contains renamings of Ada.Calendar.Time and Ada.Calendar.Clock, and an Image function.

A standard instantiation of ColdFrame.Events_G, with event basis from ColdFrame.Project.Event_Basis, time support from ColdFrame.Project.Times, and logging from ColdFrame.Project.Logging_Support.
The project subdirectory of the distribution contains Eight concrete instantiations are provided:

A standard instantiation of ColdFrame.Events_G.Standard_G, with held events from ColdFrame.Project.Held_Event_Support.

A standard instantiation of ColdFrame.Events_G.Test_G, based on ColdFrame.Project.Events.Standard.

A standard instantiation of ColdFrame.Events_G.Trace_G, based on ColdFrame.Project.Events.Standard.

A standard instantiation of ColdFrame.Events_G.Test_G, based on ColdFrame.Project.Events.Standard.Trace (ie, a Test queue, which prints what's going on).

A monitoring instantiation of ColdFrame.Events_G.Monitoring_G, with held events from ColdFrame.Project.Held_Event_Support.

A monitoring instantiation of ColdFrame.Events_G.Test_G, based on ColdFrame.Project.Events.Monitoring.

A monitoring instantiation of ColdFrame.Events_G.Trace_G, based on ColdFrame.Project.Events.Monitoring.

A monitoring instantiation of ColdFrame.Events_G.Test_G, based on ColdFrame.Project.Events.Monitoring.Trace (ie, a Test queue, which prints what's going on).

A standard instantiation of ColdFrame.Events_G.Creation_G.

Provides high resolution time measurement; used by ColdFrame.Logging_Event_Basis.

ColdFrame.Project.Log_Error, Log_Info
Report error/informational messages, using ColdFrame.Project.Logging_Support.

Generated instantiations of ColdFrame.Task_Deletion_G use ths for the actual task deletion. As supplied, this is done at System.Default_Priority - 1.

Signature packages

To help make sure that the packages you supply provide all the facilities needed, there are signature packages:

Specifies how "held events" (events posted to fire at some later time) are stored.

Specifies any user-defined extension to the serializable base type.

Specifies how time behaves.

Simon Wright