/* RCS $Id: CosQueryCollection.idl,v 1.3 1998/01/08 23:29:21 skender 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

