File: alog-transforms.ads

## Documentation

Table of Contents
Class Inheritance Tree

1.     --

2.     --  Copyright (c) 2008,

3.     --  Reto Buerki, Adrian-Ken Rueegsegger

4.     --

5.     --  This file is part of Alog.

6.     --

7.     --  Alog is free software; you can redistribute it and/or modify

8.     --  it under the terms of the GNU Lesser General Public License as published

9.     --  by the Free Software Foundation; either version 2.1 of the License, or

10.     --  (at your option) any later version.

11.     --

12.     --  Alog is distributed in the hope that it will be useful,

13.     --  but WITHOUT ANY WARRANTY; without even the implied warranty of

14.     --  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the

15.     --  GNU Lesser General Public License for more details.

16.     --

17.     --  You should have received a copy of the GNU Lesser General Public License

18.     --  along with Alog; if not, write to the Free Software

19.     --  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,

20.     --  MA  02110-1301  USA

21.     --

23.     with Ada.Strings.Unbounded;

25.     --  Abstract package Transforms. Provides methods used by all Alog transforms.

26.     package Alog.TransformsTo API docTo specTo body is

28.        use Ada.Strings.Unbounded;

30.        type InstanceTo API docTo body is abstract tagged limited private;

31.        --  Abstract type transform instance. All tranforms in the Alog framework

32.        --  must implement this type.

34.        subtype Class is InstanceTo API docTo specTo body'ClassTo API docTo spec;

36.        type Handle is access ClassTo API docTo spec;

38.        function "="To API docTo body

39.          (Left  : HandleTo API docTo spec;

40.           Right : HandleTo API docTo spec)

41.           return Boolean;

42.        --  Equal function.

44.        procedure Set_NameTo API docTo body

45.          (Transform : in out ClassTo API docTo spec;

46.           Name      :        String);

47.        --  Set transform name.

49.        function Get_NameTo API docTo body (Transform : ClassTo API docTo spec) return String;

50.        --  Get transform name.

52.        function Transform_Message

53.          (Transform : InstanceTo API docTo specTo body;

54.           Level     : Log_LevelTo API docTo spec;

55.           Msg       : String)

56.           return String is abstract;

57.        --  Transform message with specified log level.

59.        procedure Setup (Transform : in out InstanceTo API docTo specTo body) is null;

60.        --  Each transform must provide a Setup-procedure. These procedures are

61.        --  called by logger instances when attaching Transforms. All needed

62.        --  operations prior to transforming log messages should be done here.

64.        procedure Teardown (Transform : in out InstanceTo API docTo specTo body) is null;

65.        --  Each transform must provide a Teardown-procedure. These procedures are

66.        --  called by logger instances when detaching Transforms or when the logger

67.        --  object gets out of scope.

69.     private

71.        type InstanceTo API docTo spec is abstract tagged limited record

72.           Name : Unbounded_String := To_Unbounded_String ("sample-transform");

73.           --  Transform Name. Names must be unique.

74.        end record;

76.     end Alog.TransformsTo API docTo specTo body;