This site contains older material on Eiffel. For the main Eiffel page, see http://www.eiffel.com.

Appendix B : Class specification

The following is the specification of the DLE library classes.

8.1 Class DYNAMIC

    indexing
     description:
        "Instances of dynamically loadable classes";
      keywords: "Dynamic Linking in Eiffel";
      product: DLE

    class interface DYNAMIC creation
    
      make

    feature specification -- Initialization
    
      make (argument: ANY)
          -- Creation procedure.

    feature specification -- Dynamic features

      apply (feat: DYNAMIC_FEATURE)
          -- Apply feature represented by feat to current object,
          -- using the arguments specified earlier for feat.
          -- If feat represents a query. make the result accessible
          -- through feat.e_result.
        require
          feature_description_exists: feat /= Void

    end -- class DYNAMIC
    

8.2 Class DYNAMIC_CLASS

    indexing
      description:
        "Descriptions of classes that may be dynamically loaded";
      keywords: "Dynamic Linking in Eiffel";
      product: DLE

    class interface DYNAMIC_CLASS creation
    
      make

    feature specification -- Initialization

      make (class_name, dc_dir: STRING)
          -- Initialize to representation of the dynamic class of name
          -- class_name in the DC-set whose directory is dc_dir.
          -- Set retrieve_status to non-zero value if not such class
          -- can be found.
        require
          class_name_exists: class_name /= Void;
          class_name_not_empty: not class_name.empty;
          DC_set_path_exists: dc_dir /= Void;
          DC_set_path_not_empty: not dc_dir.empty

    feature specification -- Instances

      instance: DYNAMIC
          -- An instance of the class represented by the current object,
          -- initialized by procedure make of that class, using
          -- argument as argument
        require
          class_exists: not retrieve_failed
        ensure
          instance_not_void: Result /= Void

      argument: ANY
                 -- Argument to be passed to creation procedures
                 -- by subsequent calls to instance

      set_argument (val: like argument)
          -- Define val to be the argument to be passed to creation
          -- procedures by subsequent calls to instance.
        ensure
          argument_set: argument = val

    feature specification -- Status report
    
      retrieve_failed: BOOLEAN
          -- Did an error occur during last make creation call?

      retrieve_status: INTEGER
          -- Status code of the last make creation procedure

      No_error: INTEGER
          -- The class description has been correctly retrieved

      Bad_DC_directory: INTEGER
          -- dc_dir is not the name of a directory containing the
          -- proper information about a DC-set

      No_dynamic_class: INTEGER
          -- No dynamic class exists for class_name in the DC-set

      Unreadable_file: INTEGER
          -- The corresponding files in dc_dir cannot be read

      Bad_class: INTEGER
          -- There is such a class and it can be read but it is not a
           -- descendant of DYNAMIC

      Duplicate_class_name: INTEGER
          -- The retrieved class has the same name as a previously
          -- retrieved dynamic class (This error is possible because
          -- a system can use two or more DC-sets.)

      Duplicate_dc_set: INTEGER
           -- Another DC-set has already been retrieved

      Not_supported: INTEGER
          -- Unsupported mechanism

    end -- class DYNAMIC_CLASS
    

8.3 Class DYNAMIC_FEATURE

    indexing
      description:
         "Descriptions of features that may be dynamically loaded";
      keywords: "Dynamic Linking in Eiffel";
      product: DLE

    class interface

        DYNAMIC_FEATURE

    feature specification -- Access

      argument_count: INTEGER
          -- Number of arguments to be passed to the current feature
          -- description by subsequent calls to apply

    feature specification -- Setting

      set_argument_count (n: INTEGER)
          -- Set argument_count to n.
        require
          valid_n: n >= 0
        ensure
          assigned: argument_count = n

      set_boolean_argument (val: BOOLEAN; pos: INTEGER)
            -- Make val be the pos-th argument to be passed to the
            -- current feature description by subsequent calls to apply.
        require
           pos_large_enough: pos >= 1;
           pos_small_enough: pos <= argument_count

      set_character_argument (val: CHARACTER; pos: INTEGER)
            -- Make val be the pos-th argument to be passed to the
            -- current feature description by subsequent calls to apply.
         require
           pos_large_enough: pos >= 1;
           pos_small_enough: pos <= argument_count

      set_integer_argument (val: INTEGER; pos: INTEGER)
            -- Make val be the pos-th argument to be passed to the
            -- current feature description by subsequent calls to apply.
        require
          pos_large_enough: pos >= 1;
          pos_small_enough: pos <= argument_count

      set_real_argument (val: REAL; pos: INTEGER)
            -- Make val be the pos-th argument to be passed to the
            -- current feature description by subsequent calls to apply.
        require
          pos_large_enough: pos >= 1;
          pos_small_enough: pos <= argument_count

      set_double_argument (val: DOUBLE; pos: INTEGER)
            -- Make val be the pos-th argument to be passed to the
            -- current feature description by subsequent calls to apply.
        require
              pos_large_enough: pos >= 1;
              pos_small_enough: pos <= argument_count

      set_reference_argument (val: ANY; pos: INTEGER)
            -- Make val be the pos-th argument to be passed to the
            -- current feature description by subsequent calls to apply.
        require
          pos_large_enough: pos >= 1;
          pos_small_enough: pos <= argument_count

    invariant

      valid_argument_count: argument_count >= 0

end -- class DYNAMIC_FEATURE