home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Dream 52
/
Amiga_Dream_52.iso
/
Linux
/
Divers
/
lyx-0.13.2.tar.gz
/
lyx-0.13.2.tar
/
lyx-0.13.2
/
src
/
syssingleton.C
< prev
next >
Wrap
C/C++ Source or Header
|
1998-04-23
|
1KB
|
49 lines
#include <config.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/wait.h>
#include "syscontr.h"
//----------------------------------------------------------------------
// Ensure, that only one controller exist inside process
//----------------------------------------------------------------------
// global controller variable
SystemcallsSingletoncontroller *
SystemcallsSingletoncontroller::Startcontroller::
contr = NULL;
// reference count
int SystemcallsSingletoncontroller::Startcontroller::
refcount = 0;
// default constructor.
// Nothing to do at moment.
SystemcallsSingletoncontroller::Startcontroller::
Startcontroller()
{
}
// default destructor.
// Nothing to do at moment
SystemcallsSingletoncontroller::Startcontroller::
~Startcontroller()
{
}
// Give reference to global controller-instance
//
SystemcallsSingletoncontroller *
SystemcallsSingletoncontroller::Startcontroller::
GetController()
{
if (! contr)
{ // generate the global controller
contr = new SystemcallsSingletoncontroller;
}
refcount++;
return contr;
}