/* Copyright (c) 2001-2004 by SoftIntegration, Inc. All Rights Reserved */
#ifndef _SAMPCLASS_H_
#define _SAMPCLASS_H_

#ifdef _CH_
#include <dlfcn.h>
void *g_sample_dlhandle = dlopen("libsampclass.dl", RTLD_LAZY);
if(g_sample_dlhandle == NULL) {
   fprintf(_stderr, "Error: dlopen(): %s\n", dlerror());
   fprintf(_stderr, "       cannot get g_sample_dlhandle in sampclass.h\n");
   exit(-1);
}
void _dlclose_sampclass(void) {
   dlclose(g_sample_dlhandle);
}
atexit(_dlclose_sampclass);

class Class1 {
  public:
    Class1();
    ~Class1();
    int memfun1(int i);
};

class Class2 {
  public:
    Class2();
    ~Class2();
    Class1 memfun1();      // return Class1 
    int memfun2(Class1 c); // arg of Class1
};

#pragma importf "sampclass.chf"
#else
class Class1 {
  private: 
    int m_i1;
  public:
    Class1();
    ~Class1();
    int memfun1(int i);
};

class Class2 {
  private:
    int m_i2;
  public:
    Class2();
    ~Class2();
    Class1 memfun1();            // return Class1 
    int memfun2(class Class1 c); // arg of Class1
};
#endif

#endif /* _SAMPCLASS_H_ */
