/*********************************************************************/
/*                  pC++/Sage++  Copyright (C) 1993,1995             */
/*  Indiana University  University of Oregon  University of Rennes   */
/*********************************************************************/

#include "pcxx.h"
#include "pcxx_events.h"  // Include event tracing definitions
#define SIZE 64

// This is the basic class that represents the distributed function and data
class MyElement{
 public:
   void hello() { printf(" hello world\n"); };
};

// kernel.h must be included AFTER the element classes are defined
#include "kernel.h"

// Define the collection:
Collection MyCollection: SuperKernel
{
  public:
    MyCollection(Distribution *T, Align *A);  // Constructor declaration
  MethodOfElement:
    // Data and functions added to each basic element
    virtual void hello();
};

// Collection Constructor definition:
MyCollection::MyCollection(Distribution *T, Align *A):SuperKernel(T, A)
{  /*
   a constructor for user defined collection has to be 
   defined to ensure that base collection is initialized.
   */
};

// The thread of control run on each processor
void Processor_Main(int argc, char **argv)
{
  Processors P;                        
  Distribution T(SIZE,&P,BLOCK);       
  Align A(SIZE,"[ALIGN(V[i],T[i])]");
  MyCollection<MyElement> X(&T,&A);    // Construct the Collection X
  PCXX_EVENT(PCXX_EC_BASIC, PCXX_USERCODE_ENTER, 0);  // Some Tracing functions

}
