home *** CD-ROM | disk | FTP | other *** search
- /*************************************************************************
- * Copyright (c) 1989-1993 Micro Digital Associates, Inc.
- * All Rights Reserved.
- *
- * MODULE: dprocess.cpp
- *
- * DESRIPTION: This module contains all the class methods for the
- * dprocess class.
- *
- *
- * AUTHOR: Rick Evans
- *
- *
- * UPDATE LOG
- *
- *************************************************************************/
-
- //--- Header Files --------
-
- #include <core.h>
- #include <dprocess.hpp>
-
- //---- Global Varibles -----
-
- //----- Local Varibles -----
-
- //------- Functions --------
- /*************************************************************************
- *
- * NAME: DPROCESS
- *
- * DESRIPTION:
- * This is the dprocess constructor. It not only constructs
- * the dprocess but also calls the constructors for the
- * other objects in dprocess.
- *
- *
- * INPUTS:
- * none
- * OUTPUTS:
- none
- *
- * RETURN: none
- *
- *************************************************************************/
- DProcess::DProcess(const void(*Task1)(), const void(*Task2)(),
- const void(*Task3)(), const void(*Task4)(),
- const void(*Task5)() ) : DiskDemo ( Task1, MIN ),
- ErrGen ( Task2, HI ), OpCon ( Task3, MAX ),
- Preempter( Task4, HI ), Sleeper ( Task5, NORM )
- {
- // This is were you can do any initialization for your process.
- ;
- }
-
-
- /*************************************************************************
- *
- * NAME: START
- *
- * DESRIPTION:
- * This method is used to start the process. All the tasks
- * are started.
- *
- *
- * INPUTS:
- * none
- * OUTPUTS:
- none
- *
- * RETURN:
- * A FALSE value is returned is one of the classes is not
- * created else a TRUE is returned.
- *
- *************************************************************************/
- BOOLEAN DProcess::Start()
- {
- BOOLEAN b;
-
- b = OpCon.Start();
- if (b)
- b = DiskDemo.Start();
- if (b)
- b = Sleeper.Start();
- if (b)
- b = Preempter.Start();
- //if (b)
- //b = ErrGen.Start();
- if(!b)
- (void)ShutDown();
-
- return b;
- }
-
- /*************************************************************************
- *
- * NAME: SHUTDOWN
- *
- * DESRIPTION:
- * This method is used to shut down the process. All the task
- * are stopped. The destructor for the class is called from
- * the process destructor.
- *
- * INPUTS:
- * none
- * OUTPUTS:
- none
- *
- * RETURN:
- * A FALSE value is returned is one of the classes is not
- * created else a TRUE is returned.
- *
- *************************************************************************/
- BOOLEAN DProcess::ShutDown()
- {
- BOOLEAN b;
-
- b= TRUE;
- if(!OpCon.Stop())
- b = FALSE;
- if(!DiskDemo.Stop())
- b = FALSE;
- if(!Sleeper.Stop())
- b = FALSE;
- if(!Preempter.Stop())
- //if(!ErrGen.Stop())
- // b = FALSE;
-
- return b;
- }
-