import ::RTCORBA;

module DHB {
  // This module is derived from the Distributed Hartstone
  // benchmarks. It is used to bench PolyORB internals.

  typedef unsigned long KWIPS;
  // Represent the number of Kilo Whetstone Instruction Per Second

  interface Worker {
    // A Worker is a remote entity that performs some work on behalf
    // of a client entity. This interface defines functions that serve
    // to measure some metrics of the underlying ORB.

    typedef sequence<unsigned long> U_sequence;

    void Do_Some_Work (in KWIPS Kilo_Whetstone);
    // Worker performs Kilo_Whestone operations

    void Do_Some_Work_With_Payload (in KWIPS Kilo_Whetstone,
				    in U_sequence Payload);
    // Worker performs Kilo_Whestone operations + transmit some Payload

    KWIPS Get_KWIPS ();
    // Return the number of Kilo Whetstone Instruction Per Seconds
    // that the worker can provide
  
    RTCORBA::Priority Running_Priority ();
    // Return the running priority of the servant

    unsigned long Round_Trip (in unsigned long data);
    // Round trip with data as payload, simply return data

    U_sequence Round_Trip_With_Payload (in U_sequence Payload);
    // Round trip with some more payload, simply return Payload

    oneway void Ping (in unsigned long data);
    // Ping the remote node

  };

  interface Worker_Factory {
    // A factory of Workers

    Worker Create ();

    void Destroy (in Worker The_Worker);

  };

  interface Background_Worker {
    // A Background_Worker is a remote entity that performs some work
    // in background.

    KWIPS Get_KWIPS ();
    // Return the number of Kilo Whetstone Instruction Per Seconds
    // that the worker can provide

    oneway void Do_Background_Work (in KWIPS Kilo_Whetstone,
				    in RTCORBA::Priority Priority);

    boolean Is_Working ();
    // Return true iff Background_Worker is acutally performing some work

  };

  interface Background_Worker_Factory {
    // A factory of Background_Workers

    Background_Worker Create ();

    void Destroy (in Background_Worker The_Worker);

  };

};
