/* RCS $Id: CosQueryCollection.idl,v 1.1 1998/11/16 18:03:34 scrappy Exp $
 *
 * ----------------------------------------------------------------------------
 * This is unmarked software provided by the Object Management Group,Inc. (OMG)
 * ----------------------------------------------------------------------------
 */


/**
 * CosQueryCollection is the Common Object Services Specification query 
 * query colleciton module as it it appears in COSS1, v1.0.
 */


#ifndef CosQueryCollection_idl
#define CosQueryCollection_idl

module CosQueryCollection {

  exception ElementInvalid {}; 
  exception IteratorInvalid {}; 
  exception PositionInvalid {};

  typedef string Istring; 
  struct NVPair {
    Istring name; 
    any value;
  }; 

  typedef sequence<NVPair> ParameterList;

  interface Collection; 
  interface Iterator;

  interface CollectionFactory { 
    Collection create (in ParameterList params); 
  };

  interface Collection { 

    readonly attribute long cardinality;

    void add_element (in any element) 
      raises(ElementInvalid); 

    void add_all_elements (in Collection elements)  
      raises(ElementInvalid);

    void insert_element_at (in any element, in Iterator where)  
      raises(IteratorInvalid,
	     ElementInvalid);

    void replace_element_at (in any element, in Iterator  where) 
      raises(IteratorInvalid,
	     PositionInvalid,
	     ElementInvalid);

    void remove_element_at (in Iterator where)  
      raises(IteratorInvalid,
	     PositionInvalid); 

    void remove_all_elements ();

    any retrieve_element_at (in Iterator where)  
      raises(IteratorInvalid,
	     PositionInvalid);

    Iterator create_iterator ();

  };

  interface Iterator { 
    any next ()
      raises(IteratorInvalid,
	     PositionInvalid);
    void reset ();
    boolean more (); 
  }; 

};

#endif // CosQueryCollection_idl

