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

ColdFrame.Callbacks
Provides callback (Observer) support.

ColdFrame.Events_G
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; a "no-frills" version is in ColdFrame.Events_Basis.
Child packages are

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

ColdFrame.Events_G.Standard_G
A straightforward event queueing and dispatching service.

ColdFrame.Events_G.Test_G
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).

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

ColdFrame.Exceptions
Provides exceptions.

ColdFrame.Exceptions.Message
Provides exception reporting (to standard output).

ColdFrame.Exceptions.Symbolic_Traceback
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.

ColdFrame.Exceptions.Traceback
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.

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

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

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

ColdFrame.Hash.Strings
A family of hash functions for strings.

ColdFrame.Hash.Strings.Bounded
A hash function for Bounded Strings.

ColdFrame.Hash.Strings.Standard
A hash function for standard Strings.

ColdFrame.Hash.Strings.Unbounded
A hash function for Unbounded Strings.

ColdFrame.Instances
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.

ColdFrame.Interrupts
Provides support for (simple) interrupt handling.

ColdFrame.Task_Deletion_G
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 directories cf-yyyymmdd/lib and /lib/standard (for unrestricted runtimes, /lib/ravenscar for restricted runtimes) while the sample project code below is under cf-yyyymmdd/project and, similarly, /project/standard or project/ravenscar.

ColdFrame.Project.Calendar
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

ColdFrame.Project.Events
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 the standard instantiation. Eight concrete instantiations are provided:

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

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

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

ColdFrame.Project.Events.Standard.Test_Trace
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).

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

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

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

ColdFrame.Project.Events.Monitoring.Test_Trace
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).

ColdFrame.Project.High_Resolution_Time
Provides high resolution time measurement.

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

ColdFrame.Project.Task_Deletion
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:

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

ColdFrame.Time_Signature
Specifies how time behaves.