/*
   b_ptr_siginfo_t.cpp   Generated by the Ballista(tm) Project data object compiler
   Copyright (C) 1998-2001  Carnegie Mellon University

   This program is free software; you can redistribute it and/or
   modify it under the terms of the GNU General Public License
   as published by the Free Software Foundation; either version 2
   of the License, or (at your option) any later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.

   File generated Wednesday, May 23 at 03:22 PM EDT

TITLE
   b_ptr_siginfo_t.cpp
*/

//--------------------------------------------------------------------

#include <errno.h>
#include <iostream.h>
#include <stdio.h>
#include <stdlib.h>
#include <stream.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>

#include "b_ptr_siginfo_t.h"

//--------------------------------------------------------------------


static siginfo_t siginfo_t_temp;
//--------------------------------------------------------------------

CLASSNAME::CLASSNAME()
{
  //DIAL DECLARATIONS HERE

  //generated

   strcpy(_b_ptr_siginfo_tTYPENAME,CLASS_STRING);
strcpy(_b_ptr_siginfo_tSIGABRT,"b_ptr_siginfo_t_SIGABRT");
strcpy(_b_ptr_siginfo_tSIGILL,"b_ptr_siginfo_t_SIGILL");
strcpy(_b_ptr_siginfo_tSIGUSR1,"b_ptr_siginfo_t_SIGUSR1");
strcpy(_b_ptr_siginfo_tSIGUSR2,"b_ptr_siginfo_t_SIGUSR2");
strcpy(_b_ptr_siginfo_tMAXINT,"b_ptr_siginfo_t_MAXINT");
strcpy(_b_ptr_siginfo_tMININT,"b_ptr_siginfo_t_MININT");
strcpy(_b_ptr_siginfo_tZERO,"b_ptr_siginfo_t_ZERO");
strcpy(_b_ptr_siginfo_tONE,"b_ptr_siginfo_t_ONE");
strcpy(_b_ptr_siginfo_tNEG_ONE,"b_ptr_siginfo_t_NEG_ONE");
strcpy(_b_ptr_siginfo_tSI_USER,"b_ptr_siginfo_t_SI_USER");
strcpy(_b_ptr_siginfo_tSI_QUEUE,"b_ptr_siginfo_t_SI_QUEUE");
strcpy(_b_ptr_siginfo_tSI_TIMER,"b_ptr_siginfo_t_SI_TIMER");
strcpy(_b_ptr_siginfo_tSI_ASYNCIO,"b_ptr_siginfo_t_SI_ASYNCIO");
strcpy(_b_ptr_siginfo_tSI_MESGQ,"b_ptr_siginfo_t_SI_MESGQ");
strcpy(_b_ptr_siginfo_tC_MAXINT,"b_ptr_siginfo_t_C_MAXINT");
strcpy(_b_ptr_siginfo_tC_MININT,"b_ptr_siginfo_t_C_MININT");
strcpy(_b_ptr_siginfo_tC_ZERO,"b_ptr_siginfo_t_C_ZERO");
strcpy(_b_ptr_siginfo_tC_ONE,"b_ptr_siginfo_t_C_ONE");
strcpy(_b_ptr_siginfo_tC_NEG_ONE,"b_ptr_siginfo_t_C_NEG_ONE");
}

//--------------------------------------------------------------------
b_param *b_ptr_siginfo_t::b_ptr_siginfo_tSIGABRT()
{
   return &_b_ptr_siginfo_tSIGABRT;
}

b_param *b_ptr_siginfo_t::b_ptr_siginfo_tSIGILL()
{
   return &_b_ptr_siginfo_tSIGILL;
}

b_param *b_ptr_siginfo_t::b_ptr_siginfo_tSIGUSR1()
{
   return &_b_ptr_siginfo_tSIGUSR1;
}

b_param *b_ptr_siginfo_t::b_ptr_siginfo_tSIGUSR2()
{
   return &_b_ptr_siginfo_tSIGUSR2;
}

b_param *b_ptr_siginfo_t::b_ptr_siginfo_tMAXINT()
{
   return &_b_ptr_siginfo_tMAXINT;
}

b_param *b_ptr_siginfo_t::b_ptr_siginfo_tMININT()
{
   return &_b_ptr_siginfo_tMININT;
}

b_param *b_ptr_siginfo_t::b_ptr_siginfo_tZERO()
{
   return &_b_ptr_siginfo_tZERO;
}

b_param *b_ptr_siginfo_t::b_ptr_siginfo_tONE()
{
   return &_b_ptr_siginfo_tONE;
}

b_param *b_ptr_siginfo_t::b_ptr_siginfo_tNEG_ONE()
{
   return &_b_ptr_siginfo_tNEG_ONE;
}

b_param *b_ptr_siginfo_t::b_ptr_siginfo_tSI_USER()
{
   return &_b_ptr_siginfo_tSI_USER;
}

b_param *b_ptr_siginfo_t::b_ptr_siginfo_tSI_QUEUE()
{
   return &_b_ptr_siginfo_tSI_QUEUE;
}

b_param *b_ptr_siginfo_t::b_ptr_siginfo_tSI_TIMER()
{
   return &_b_ptr_siginfo_tSI_TIMER;
}

b_param *b_ptr_siginfo_t::b_ptr_siginfo_tSI_ASYNCIO()
{
   return &_b_ptr_siginfo_tSI_ASYNCIO;
}

b_param *b_ptr_siginfo_t::b_ptr_siginfo_tSI_MESGQ()
{
   return &_b_ptr_siginfo_tSI_MESGQ;
}

b_param *b_ptr_siginfo_t::b_ptr_siginfo_tC_MAXINT()
{
   return &_b_ptr_siginfo_tC_MAXINT;
}

b_param *b_ptr_siginfo_t::b_ptr_siginfo_tC_MININT()
{
   return &_b_ptr_siginfo_tC_MININT;
}

b_param *b_ptr_siginfo_t::b_ptr_siginfo_tC_ZERO()
{
   return &_b_ptr_siginfo_tC_ZERO;
}

b_param *b_ptr_siginfo_t::b_ptr_siginfo_tC_ONE()
{
   return &_b_ptr_siginfo_tC_ONE;
}

b_param *b_ptr_siginfo_t::b_ptr_siginfo_tC_NEG_ONE()
{
   return &_b_ptr_siginfo_tC_NEG_ONE;
}

//--------------------------------------------------------------------
//---------------------------------------------------------------------------
//type name return method

b_param *CLASSNAME::typeName()
{
  return &_b_ptr_siginfo_tTYPENAME;
}

//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
int CLASSNAME::distanceFromBase()
{
  return CLASSPARENT::distanceFromBase() +1;
}


//---------------------------------------------------------------------------
void CLASSNAME::typeList(b_param list[], int num)
{
  strcpy(list[num],(char *) typeName());
  CLASSPARENT::typeList(list,num+1);
}
//--------------------------------------------------------------------
  void *CLASSNAME::access(b_param data[])
{
  if (strcmp(data[0],(char *)typeName())!=0)
    return CLASSPARENT::access(data);

  //ACCESS CODE
b_ptr_siginfo_t_sigabrt = 0;
b_ptr_siginfo_t_sigill = 0;
b_ptr_siginfo_t_sigusr1 = 0;
b_ptr_siginfo_t_sigusr2 = 0;
b_ptr_siginfo_t_maxint = 0;
b_ptr_siginfo_t_minint = 0;
b_ptr_siginfo_t_zero = 0;
b_ptr_siginfo_t_one = 0;
b_ptr_siginfo_t_neg_one = 0;
b_ptr_siginfo_t_si_user = 0;
b_ptr_siginfo_t_si_queue = 0;
b_ptr_siginfo_t_si_timer = 0;
b_ptr_siginfo_t_si_asyncio = 0;
b_ptr_siginfo_t_si_mesgq = 0;
b_ptr_siginfo_t_c_maxint = 0;
b_ptr_siginfo_t_c_minint = 0;
b_ptr_siginfo_t_c_zero = 0;
b_ptr_siginfo_t_c_one = 0;
b_ptr_siginfo_t_c_neg_one = 0;
   int dataPTR =0;


   dataPTR++;
if (strcmp(data[dataPTR],_b_ptr_siginfo_tSIGABRT)==0)
      b_ptr_siginfo_t_sigabrt = 1;
   else if (strcmp(data[dataPTR],_b_ptr_siginfo_tSIGILL)==0)
      b_ptr_siginfo_t_sigill = 1;
   else if (strcmp(data[dataPTR],_b_ptr_siginfo_tSIGUSR1)==0)
      b_ptr_siginfo_t_sigusr1 = 1;
   else if (strcmp(data[dataPTR],_b_ptr_siginfo_tSIGUSR2)==0)
      b_ptr_siginfo_t_sigusr2 = 1;
   else if (strcmp(data[dataPTR],_b_ptr_siginfo_tMAXINT)==0)
      b_ptr_siginfo_t_maxint = 1;
   else if (strcmp(data[dataPTR],_b_ptr_siginfo_tMININT)==0)
      b_ptr_siginfo_t_minint = 1;
   else if (strcmp(data[dataPTR],_b_ptr_siginfo_tZERO)==0)
      b_ptr_siginfo_t_zero = 1;
   else if (strcmp(data[dataPTR],_b_ptr_siginfo_tONE)==0)
      b_ptr_siginfo_t_one = 1;
   else if (strcmp(data[dataPTR],_b_ptr_siginfo_tNEG_ONE)==0)
      b_ptr_siginfo_t_neg_one = 1;
  else
    {
      cerr<<"Error: Unknown setting for the "
          <<"SI_SIGNO"
          <<" dial of the data object "
          <<CLASS_STRING
          <<". "<<endl
          <<"The offending string is : "
          <<data[dataPTR]
          <<endl;
      exit(1);
    }

   dataPTR++;
if (strcmp(data[dataPTR],_b_ptr_siginfo_tSI_USER)==0)
      b_ptr_siginfo_t_si_user = 1;
   else if (strcmp(data[dataPTR],_b_ptr_siginfo_tSI_QUEUE)==0)
      b_ptr_siginfo_t_si_queue = 1;
   else if (strcmp(data[dataPTR],_b_ptr_siginfo_tSI_TIMER)==0)
      b_ptr_siginfo_t_si_timer = 1;
   else if (strcmp(data[dataPTR],_b_ptr_siginfo_tSI_ASYNCIO)==0)
      b_ptr_siginfo_t_si_asyncio = 1;
   else if (strcmp(data[dataPTR],_b_ptr_siginfo_tSI_MESGQ)==0)
      b_ptr_siginfo_t_si_mesgq = 1;
   else if (strcmp(data[dataPTR],_b_ptr_siginfo_tC_MAXINT)==0)
      b_ptr_siginfo_t_c_maxint = 1;
   else if (strcmp(data[dataPTR],_b_ptr_siginfo_tC_MININT)==0)
      b_ptr_siginfo_t_c_minint = 1;
   else if (strcmp(data[dataPTR],_b_ptr_siginfo_tC_ZERO)==0)
      b_ptr_siginfo_t_c_zero = 1;
   else if (strcmp(data[dataPTR],_b_ptr_siginfo_tC_ONE)==0)
      b_ptr_siginfo_t_c_one = 1;
   else if (strcmp(data[dataPTR],_b_ptr_siginfo_tC_NEG_ONE)==0)
      b_ptr_siginfo_t_c_neg_one = 1;
  else
    {
      cerr<<"Error: Unknown setting for the "
          <<"SI_CODE"
          <<" dial of the data object "
          <<CLASS_STRING
          <<". "<<endl
          <<"The offending string is : "
          <<data[dataPTR]
          <<endl;
      exit(1);
    }

if (b_ptr_siginfo_t_sigabrt==1)
{

 siginfo_t_temp.si_signo = SIGABRT ;
 
}

if (b_ptr_siginfo_t_sigill==1)
{

 siginfo_t_temp.si_signo = SIGILL;
 
}

if (b_ptr_siginfo_t_sigusr1==1)
{

 siginfo_t_temp.si_signo = SIGUSR1;
 
}

if (b_ptr_siginfo_t_sigusr2==1)
{

 siginfo_t_temp.si_signo = SIGUSR2;
 
}

if (b_ptr_siginfo_t_maxint==1)
{

 siginfo_t_temp.si_signo = MAXINT;
 
}

if (b_ptr_siginfo_t_minint==1)
{

 siginfo_t_temp.si_signo = -MAXINT;
 
}

if (b_ptr_siginfo_t_zero==1)
{

 siginfo_t_temp.si_signo = 0;
 
}

if (b_ptr_siginfo_t_one==1)
{

 siginfo_t_temp.si_signo = 1;
 
}

if (b_ptr_siginfo_t_neg_one==1)
{

 siginfo_t_temp.si_signo = -1;
 
}

if (b_ptr_siginfo_t_si_user==1)
{

 siginfo_t_temp.si_code = SI_USER;
 
}

if (b_ptr_siginfo_t_si_queue==1)
{

 siginfo_t_temp.si_code = SI_QUEUE;
 
}

if (b_ptr_siginfo_t_si_timer==1)
{

 siginfo_t_temp.si_code = SI_TIMER;
 
}

if (b_ptr_siginfo_t_si_asyncio==1)
{

 siginfo_t_temp.si_code = SI_ASYNCIO;
 
}

if (b_ptr_siginfo_t_si_mesgq==1)
{

 siginfo_t_temp.si_code = SI_MESGQ;
 
}

if (b_ptr_siginfo_t_c_maxint==1)
{

 siginfo_t_temp.si_code = MAXINT;
 
}

if (b_ptr_siginfo_t_c_minint==1)
{

 siginfo_t_temp.si_code = -MAXINT;
 
}

if (b_ptr_siginfo_t_c_zero==1)
{

 siginfo_t_temp.si_code = 0;
 
}

if (b_ptr_siginfo_t_c_one==1)
{

 siginfo_t_temp.si_code = 1;
 
}

if (b_ptr_siginfo_t_c_neg_one==1)
{

 siginfo_t_temp.si_code = -1;
 
}

 _theVariable = &siginfo_t_temp;
   return &_theVariable;
}

//--------------------------------------------------------------------
  int CLASSNAME::commit(b_param tname)
{
  if (strcmp(tname,(char *)typeName())!=0)
    return CLASSPARENT::commit(tname);
  //COMMIT CODE HERE
//generated
   return 0;
}

//--------------------------------------------------------------------
  int CLASSNAME::cleanup(b_param tname)
{
  if (strcmp(tname,(char *)typeName())!=0)
    return CLASSPARENT::cleanup(tname);
      
  //CLEANUP CODE
//generated
   return 0;
}

//--------------------------------------------------------------------
int CLASSNAME::numDials(b_param tname)
{
  if (!strcmp(tname,(char *)typeName()))
    return NUMBER_OF_DIALS;
  else return CLASSPARENT::numDials(tname);
      
}


//---------------------------------------------------------------------------
int CLASSNAME::numItems(b_param tname,int dialNumber)
{
  if (strcmp(tname,(char *)typeName())!=0)
    return CLASSPARENT::numItems(tname,dialNumber);
  switch (dialNumber)
    {
      //NUMITEMS SWITCH CASES HERE
      //generated

   case 1:
      return 9;
      break;

   case 2:
      return 10;
      break;
//---------------------------------------------------------------------------
      //end generated

    default:
      cerr<<"Error, invalid dial number passed to "
          <<CLASS_STRING<<"::numItems\n"
          <<"Please check declaration files.  Dial number passed was "
          <<dialNumber<<endl;
      exit(1);
    }
  return 0;
}

//---------------------------------------------------------------------------
b_param *CLASSNAME::paramName(b_param tname,
                                   int dialNumber,
                                   int position)

{
  if (strcmp(tname,(char *)typeName())!=0)
    return CLASSPARENT::paramName(tname,dialNumber,position);
  
  switch (dialNumber)
    {
      //PARAMNAME SWITCH CASES HERE
      //generated

case 1:
 switch (position)
   {
      case 1:
         return b_ptr_siginfo_tSIGABRT();
         break;
      case 2:
         return b_ptr_siginfo_tSIGILL();
         break;
      case 3:
         return b_ptr_siginfo_tSIGUSR1();
         break;
      case 4:
         return b_ptr_siginfo_tSIGUSR2();
         break;
      case 5:
         return b_ptr_siginfo_tMAXINT();
         break;
      case 6:
         return b_ptr_siginfo_tMININT();
         break;
      case 7:
         return b_ptr_siginfo_tZERO();
         break;
      case 8:
         return b_ptr_siginfo_tONE();
         break;
      case 9:
         return b_ptr_siginfo_tNEG_ONE();
         break;

      default:
          cerr<<"Error, invalid position number passed to "
              <<CLASS_STRING<<"::paramName\n"
              <<"Please check declaration files.  Dial number passed was"
              <<dialNumber<<" position "<<position<<".\n";
          exit(1);
   }
   break;

case 2:
 switch (position)
   {
      case 1:
         return b_ptr_siginfo_tSI_USER();
         break;
      case 2:
         return b_ptr_siginfo_tSI_QUEUE();
         break;
      case 3:
         return b_ptr_siginfo_tSI_TIMER();
         break;
      case 4:
         return b_ptr_siginfo_tSI_ASYNCIO();
         break;
      case 5:
         return b_ptr_siginfo_tSI_MESGQ();
         break;
      case 6:
         return b_ptr_siginfo_tC_MAXINT();
         break;
      case 7:
         return b_ptr_siginfo_tC_MININT();
         break;
      case 8:
         return b_ptr_siginfo_tC_ZERO();
         break;
      case 9:
         return b_ptr_siginfo_tC_ONE();
         break;
      case 10:
         return b_ptr_siginfo_tC_NEG_ONE();
         break;

      default:
          cerr<<"Error, invalid position number passed to "
              <<CLASS_STRING<<"::paramName\n"
              <<"Please check declaration files.  Dial number passed was"
              <<dialNumber<<" position "<<position<<".\n";
          exit(1);
   }
   break;
    default:
      cerr<<"Error, invalid dial number passed to "
          <<CLASS_STRING<<"::paramName\n"
          <<"Please check declaration files.  Dial number passed was "
          <<dialNumber<<endl;
      exit(1);

    }
  return NULL;
}

//---------------------------------------------------------------------------
