CERN -> IPT Group -> FrameMaker at CERN
Information Service User's Guide

12.17 ISType


Synopsis
#include <is/type.h>
IPCPartition p( "MyPartition" );
ISInfoIterator ii( p, "MyServer" );
while ( ii() )
  cout << ii.name() << " : " << ii.type() << endl;


Description

This class identifies type of the information objects. The objects of this class should not be created by user. They are returned by several functions of the IS API and can be used for type comparison only.


Example
1: void callback( ISCallbackInfo * isc ){
2: ISInfoInt isi;
3: if ( isc->type() == isi.type() ){
4: isc->value(isi);
5: cout << isc->name() << " " << isi << endl;
6: }
7: else
8: cout << isc->name() << " has " << isc->type() << " type" << endl;
9: }


Enumeration
enum Basic{ Error = 0,Boolean, S8, U8, S16, U16, S32, U32, Float, Double, String, Date, Time };
This enumeration contains identifiers for all the basic types supported by the IS. The value of this type is returned for example by the getAttributeType method if the ISInfoAny class.


Public Constructors
ISType ( );
Constructs the new ISType object. This object will be of "invalid" type. "Invalid" type is a type for which comparison operator with any other type always return false. This type can be used to get the type of an information object in the IS repository via the findType method of the ISInfoDictionary class.
ISType ( const ISType & );
Copy constructor.


Public Member Operators
ISType  & operator=(const ISType& type);
Assignment operator. Copies a value of type to self. Returns a reference to self.
bool
operator==(const ISType& type) const;
Comparison operator. Returns true if type and self are identical, otherwise returns false.
bool
operator!=(const ISType& type) const;
Comparison operator. Returns false if type and self are identical, otherwise returns true.
ISType
operator!() const;
Constructs and returns the new type object, which is compatible with any other type but the original one.
ISType
operator~() const;
Constructs and returns the new type object, which is compatible with the original type as well ass with all the types, which inherit the original type.


Public Member Functions
bool
compatibleWith( const ISType & type ) const;
Returns true if the type type has the same structure (i.e. types and order of the attributes) as the current type. Returns false otherwise.
size_t
entries ( ) const;
Returns a number of attributes declared in this type.
Basic
entryType ( size_t index ) const;
Returns the type of the attribute declared at the index position in the current type.
bool
entryArray ( size_t index ) const;
Returns true if the attribute at the index position is array. Returns false otherwise.
bool
subTypeOf( const ISType & type ) const;
Returns true if the current type inherits from the type type. Returns false otherwise.
bool
superTypeOf( const ISType & type ) const;
Returns true if the type type inherits the current type. Returns false otherwise.
const char*
name() const;
Returns type name which has been provided to the constructor of the ISInfo class. If type name has not been provided always returns the ISType::Unknown constant string.


Related Global Operator
std::ostream  & operator<< ( std::ostream & out, ISType & ist );
Print out the name of the ist type to the standard output stream out.
std::ostream  & operator<< ( std::ostream & out, ISType::Basic & ist );
Print out the name of the ist type to the standard output stream out.
 


2 July 1998 - WebMaster
Copyright © CERN 1998