/* 
   NGObjCInstanceVariable.h

   Copyright (C) 1998 MDlink online service center, Helge Hess
   All rights reserved.

   Author: Helge Hess (helge@mdlink.de)

   This file is part of the MDlink Object Framework 2 (MOF2)

   Permission to use, copy, modify, and distribute this software and its
   documentation for any purpose and without fee is hereby granted, provided
   that the above copyright notice appear in all copies and that both that
   copyright notice and this permission notice appear in supporting
   documentation.

   We disclaim all warranties with regard to this software, including all
   implied warranties of merchantability and fitness, in no event shall
   we be liable for any special, indirect or consequential damages or any
   damages whatsoever resulting from loss of use, data or profits, whether in
   an action of contract, negligence or other tortious action, arising out of
   or in connection with the use or performance of this software.
*/
// $Id: NGObjCInstanceVariable.h,v 1.1 2000/03/20 15:45:34 mguesdon Exp $

#ifndef __NGReflection_NGObjCInstanceVariable_H__
#define __NGReflection_NGObjCInstanceVariable_H__

#import <Foundation/NSObject.h>

@class NSString;
@class NGObjCClass;

@interface NGObjCInstanceVariable : NSObject
{
@protected
  NGObjCClass *class;
  void        *internalRepresentation;
  const char  *type;
  BOOL        ownsRepresentation;
}

+ (id)ivarWithInternalRepresentation:(void *)_irep
  ownsRepresentation:(BOOL)_ownsRepresentation;
- (id)initWithInternalRepresentation:(void *)_irep
  ownsRepresentation:(BOOL)_ownsRepresentation;
- (id)initWithName:(NSString *)_name type:(NSString  *)_type;

// accessors

- (NSString *)variableName;
- (NSString *)variableType;
- (NGObjCClass *)variableClass;
- (int)offset;

#ifdef LIB_FOUNDATION_BOEHM_GC
- (void)setGCVisibility:(BOOL)_visibility;
- (BOOL)isGCInvisible;
#endif

// type

- (BOOL)isPrimitiveType;
- (BOOL)isPointerType;
- (BOOL)isObjectType; // id or class
- (BOOL)isClassType;

- (NSString *)objectType; // the name of the class

- (BOOL)isUnionType;
- (BOOL)isStructureType;
- (BOOL)isArrayType;

// value

- (BOOL)setValue:(void *)_value inObject:(id)_object;
- (BOOL)getValue:(void *)_value inObject:(id)_object;

// ObjC

- (NSString *)typeAsObjectiveC;

@end

#endif /* __NGReflection_NGObjCInstanceVariable_H__ */
