// This is -*- c++ -*- code 
// $Id: typeinfo.h,v 1.2 1995/11/25 10:14:10 hartmans Exp $

#ifndef __TYPEINFO_H__
#define __TYPEINFO_H__

//  This file provides a mechanism for  generating unique  type identifiers for use by force. 

typedef unsigned long typeinfo_t;

typeinfo_t new_typeinfo();
// Effects: returns a new typeinfo type that has never been used before.
#define force_ptr(ref,type) ((type *)(ref).force(type::typeinfo))
// Requires: type be a type with a static typeinfo member, ref be a
// reference or variable (or dereferenced pointer) of the appropriate
// type, type have a force method that functions as expected
// Effects: returns a pointer to type, instead of one its base types if the
// coersion is well-defined, else returns null.


#endif
