Kaydet (Commit) ab9eecc5 authored tarafından Norbert Thiebaud's avatar Norbert Thiebaud

Finally, gut the vos module out of the build

üst 08be4cfe
ph comphelper : cppuhelper ucbhelper offuh vos salhelper NULL
ph comphelper : cppuhelper ucbhelper offuh salhelper NULL
ph comphelper usr1 - all ph_mkout NULL
ph comphelper\inc nmake - all ph_inc NULL
ph comphelper\source\container nmake - all ph_container ph_inc NULL
......
......@@ -54,7 +54,7 @@ SHL1STDLIBS= \
$(CPPUHELPERLIB) \
$(CPPULIB) \
$(UCBHELPERLIB) \
$(VOSLIB)
SHL1DEPN=
SHL1IMPLIB= i$(COMPHLP_TARGET)
......
dr dtrans : unotools offapi offuh rdbmaker vos stoc NULL
dr dtrans : unotools offapi offuh rdbmaker stoc NULL
dr dtrans usr1 - all dr_mkout NULL
dr dtrans\inc nmake - all dr_inc NULL
dr dtrans\source\cnttype nmake - all dr_cnttype dr_generic dr_inc NULL
......
......@@ -62,9 +62,8 @@ APP1OBJS = $(OBJFILES)
APP1STDLIBS =\
$(TOOLSLIB)\
$(EXPATASCII3RDLIB)\
$(VOSLIB)\
$(CPPULIB) \
$(SALLIB)
$(SALLIB)
# --- Targets ------------------------------------------------------
......
......@@ -27,9 +27,11 @@
************************************************************************/
#include <com/sun/star/xml/sax/SAXException.hpp>
#include <l10ntools/vosapp.hxx>
#include <osl/file.hxx>
#include <osl/process.h>
#include <l10ntools/vosapp.hxx>
#include "export.hxx"
#include "layoutparse.hxx"
......
......@@ -81,7 +81,6 @@ APP1OBJS= $(OBJ)$/src_yy_wrapper.obj
APP1STDLIBS+= \
$(TOOLSLIB) \
$(VOSLIB) \
$(SALLIB)
.IF "$(OS)"=="MACOSX"
......@@ -98,7 +97,7 @@ APP2RPATH= NONE
.IF "$(OS)"!="MACOSX"
.ENDIF
APP2STDLIBS+=$(SALLIB) $(EXPATASCII3RDLIB) $(TOOLSLIB) $(VOSLIB)
APP2STDLIBS+=$(SALLIB) $(EXPATASCII3RDLIB) $(TOOLSLIB)
.IF "$(OS)"=="MACOSX"
# static libs at end for OS X
......@@ -114,7 +113,6 @@ APP3RPATH= NONE
.ENDIF
APP3STDLIBS+= \
$(TOOLSLIB) \
$(VOSLIB) \
$(SALLIB)
.IF "$(OS)"=="MACOSX"
# static libs at end for OS X
......@@ -125,7 +123,6 @@ APP4TARGET= gsiconv
APP4OBJS= $(OBJ)$/utf8conv.obj $(OBJ)$/gsiconv.obj
APP4STDLIBS+= \
$(TOOLSLIB) \
$(VOSLIB) \
$(SALLIB)
# tag checker for *.gsi
......@@ -133,7 +130,6 @@ APP5TARGET= gsicheck
APP5OBJS= $(OBJ)$/gsicheck.obj $(OBJ)$/tagtest.obj
APP5STDLIBS+= \
$(TOOLSLIB) \
$(VOSLIB) \
$(SALLIB)
# extractor and merger for *.cfg
......@@ -146,7 +142,6 @@ APP6OBJS= $(OBJ)$/cfgmerge.obj $(OBJ)$/cfg_yy_wrapper.obj $(OBJ)$/merge.obj $
APP6STDLIBS+= \
$(TOOLSLIB) \
$(VOSLIB) \
$(SALLIB)
.IF "$(OS)"=="MACOSX"
......@@ -163,7 +158,6 @@ APP7RPATH= NONE
APP7STDLIBS+= \
$(TOOLSLIB) \
$(VOSLIB) \
$(SALLIB)
.IF "$(OS)"=="MACOSX"
......@@ -173,7 +167,7 @@ APP7STDLIBS+= \
#
#APP8TARGET= treeconfig
#APP8OBJS= $(OBJ)$/treeconfig.obj $(OBJ)$/inireader.obj $(OBJ)$/export2.obj
#APP8STDLIBS=$(TOOLSLIB) $(SALLIB) $(VOSLIB) $(ICUINLIB) $(STLPORT)
#APP8STDLIBS=$(TOOLSLIB) $(SALLIB) $(ICUINLIB) $(STLPORT)
# localizer for l10n framework
APP9TARGET= localize_sl
......@@ -183,7 +177,6 @@ APP9OBJS= $(OBJ)$/localize.obj $(OBJ)$/utf8conv.obj $(OBJ)$/srciter.obj $(OBJ)
APP9STDLIBS+= \
$(TOOLSLIB) \
$(VOSLIB) \
$(ICUINLIB) \
$(ICUUCLIB) \
$(STLPORTLIB) \
......
......@@ -42,7 +42,7 @@ OBJFILES= $(OBJ)$/gui.obj \
$(OBJ)$/start.obj
APP1TARGET= rsc
APP1STDLIBS=$(TOOLSLIB) $(I18NISOLANGLIB) $(VOSLIB) $(SALLIB) # $(RTLLIB)
APP1STDLIBS=$(TOOLSLIB) $(I18NISOLANGLIB) $(SALLIB) # $(RTLLIB)
APP1LIBS= $(LB)$/rsctoo.lib
APP1OBJS= $(OBJ)$/start.obj
.IF "$(GUI)" != "OS2"
......@@ -56,9 +56,9 @@ APP2TARGET= rsc2
.IF "$(OS)"=="SCO"
# SCO hat Probleme mit fork/exec und einigen shared libraries.
# rsc2 muss daher statisch gelinkt werden
APP2STDLIBS=$(STATIC) -latools $(BPICONVLIB) $(VOSLIB) $(OSLLIB) $(RTLLIB) $(DYNAMIC)
APP2STDLIBS=$(STATIC) -latools $(BPICONVLIB) $(OSLLIB) $(RTLLIB) $(DYNAMIC)
.ELSE
APP2STDLIBS=$(TOOLSLIB) $(I18NISOLANGLIB) $(VOSLIB) $(SALLIB) # $(RTLLIB)
APP2STDLIBS=$(TOOLSLIB) $(I18NISOLANGLIB) $(SALLIB) # $(RTLLIB)
.ENDIF
APP2LIBS= $(LB)$/rsctoo.lib \
$(LB)$/rscres.lib \
......
......@@ -50,7 +50,6 @@ SHL1USE_EXPORTS=name
SHL1LIBS= $(LIB1TARGET)
SHL1STDLIBS= \
$(VOSLIB) \
$(CPPULIB) \
$(CPPUHELPERLIB)\
$(COMPHELPERLIB)\
......
......@@ -82,7 +82,6 @@ SHL1STDLIBS= \
$(COMPHELPERLIB) \
$(CPPUHELPERLIB) \
$(CPPULIB) \
$(VOSLIB) \
$(SOTLIB) \
$(SALLIB)
......
......@@ -50,7 +50,6 @@ APP1TARGET= $(TARGET)
APP1STDLIBS = \
$(VCLLIB) \
$(TOOLSLIB) \
$(VOSLIB) \
$(SALLIB)
APP1OBJS= $(OBJ)$/bmp.obj \
......@@ -66,7 +65,6 @@ APP2OBJS = $(OBJ)$/bmpsum.obj
APP2STDLIBS = $(VCLLIB) \
$(TOOLSLIB) \
$(VOSLIB) \
$(SALLIB)
# --- Targets ------------------------------------------------------
......
......@@ -50,7 +50,6 @@ APP1STDLIBS= $(CPPULIB) \
$(COMPHELPERLIB) \
$(UNOTOOLSLIB) \
$(SALLIB) \
$(VOSLIB) \
$(TOOLSLIB) \
$(VCLLIB)
......
......@@ -120,7 +120,6 @@ SHL1STDLIBS+= \
$(COMPHELPERLIB) \
$(CPPUHELPERLIB) \
$(CPPULIB) \
$(VOSLIB) \
$(SALLIB) \
$(SALHELPERLIB) \
$(ICUUCLIB) \
......@@ -170,7 +169,6 @@ APP2STDLIBS+= -lsvl$(DLLPOSTFIX)
APP2STDLIBS+= $(VCLLIB) \
$(TOOLSLIB) \
$(VOSLIB) \
$(SALLIB)
# --- Targets ------------------------------------------------------
......
......@@ -47,7 +47,6 @@ APP4STDLIBS= \
$(SVLLIB) \
$(VCLLIB) \
$(TOOLSLIB) \
$(VOSLIB) \
$(SALLIB)
.IF "$(GUI)"=="WNT" || "$(COM)"=="GCC"
APP4STDLIBS+= $(CPPULIB)
......
......@@ -48,7 +48,6 @@ APP1STDLIBS= $(SVTOOLLIB) \
$(COMPHELPERLIB) \
$(TOOLSLIB) \
$(SALLIB) \
$(VOSLIB) \
$(CPPUHELPERLIB) \
$(CPPULIB)
......
......@@ -56,8 +56,6 @@
../../vcl/unxlngi6.pro/inc
../../ure/unxlngi6.pro/inc
../../uui/unxlngi6.pro/inc
../../vos/inc
../../vos/unxlngi6.pro/inc
../../dbaccess/inc
../../dbaccess/source/ui/inc
../../dbaccess/source/inc
......
......@@ -39,7 +39,7 @@ TARGETTYPE=CUI
APP1TARGET= mkunroll
APP1OBJS= $(OBJ)$/mkfilt.obj
APP1STDLIBS= $(SALLIB) $(VOSLIB) $(TOOLSLIB)
APP1STDLIBS= $(SALLIB) $(TOOLSLIB)
.IF "$(OS)"=="LINUX"
APP1STDLIBS+=-lpthread
.ENDIF
......
......@@ -81,12 +81,12 @@ LIB2OBJFILES=\
APP1TARGET= sspretty
APP1OBJS= $(OBJ)$/sspretty.obj
APP1LIBS= $(LB)$/$(TARGET).lib $(LB)$/$(TARGET1).lib
APP1STDLIBS=$(SALLIB) $(VOSLIB) $(TOOLSLIB) $(BASEGFXLIB) $(UCBHELPERLIB) $(CPPULIB) $(COMPHELPERLIB) $(CPPUHELPERLIB) $(SALHELPERLIB) $(I18NISOLANGLIB)
APP1STDLIBS=$(SALLIB) $(TOOLSLIB) $(BASEGFXLIB) $(UCBHELPERLIB) $(CPPULIB) $(COMPHELPERLIB) $(CPPUHELPERLIB) $(SALHELPERLIB) $(I18NISOLANGLIB)
APP2TARGET= rscdep
APP2OBJS= $(OBJ)$/rscdep.obj
APP2LIBS= $(LB)$/$(TARGET).lib $(LB)$/$(TARGET1).lib
APP2STDLIBS= $(SALLIB) $(VOSLIB) $(TOOLSLIB) $(BASEGFXLIB) $(UCBHELPERLIB) $(CPPULIB) $(COMPHELPERLIB) $(I18NISOLANGLIB) $(CPPUHELPERLIB) $(SALHELPERLIB)
APP2STDLIBS= $(SALLIB) $(TOOLSLIB) $(BASEGFXLIB) $(UCBHELPERLIB) $(CPPULIB) $(COMPHELPERLIB) $(I18NISOLANGLIB) $(CPPUHELPERLIB) $(SALHELPERLIB)
.IF "$(HAVE_GETOPT)" != "YES"
.IF "$(OS)"=="WNT"
APP2STDLIBS+=gnu_getopt.lib
......@@ -99,7 +99,7 @@ APP2RPATH= NONE
APP3TARGET= so_checksum
APP3OBJS= $(OBJ)$/md5.obj \
$(OBJ)$/so_checksum.obj
APP3STDLIBS= $(TOOLSLIB) $(SALLIB) $(VOSLIB) $(BASEGFXLIB) $(UCBHELPERLIB) $(CPPULIB) $(COMPHELPERLIB) $(I18NISOLANGLIB) $(CPPUHELPERLIB) $(SALHELPERLIB)
APP3STDLIBS= $(TOOLSLIB) $(SALLIB) $(BASEGFXLIB) $(UCBHELPERLIB) $(CPPULIB) $(COMPHELPERLIB) $(I18NISOLANGLIB) $(CPPUHELPERLIB) $(SALHELPERLIB)
DEPOBJFILES = $(APP1OBJS) $(APP2OBJS) $(APP3OBJS)
......
tl tools : cppu external offuh vos ZLIB:zlib EXPAT:expat basegfx comphelper i18npool NULL
tl tools : cppu external offuh ZLIB:zlib EXPAT:expat basegfx comphelper i18npool NULL
tl tools usr1 - all tl_mkout NULL
tl tools\bootstrp\isdll get - all tl_bsisdll NULL
tl tools\bootstrp\addexes get - all tl_bsexes NULL
......
......@@ -94,8 +94,8 @@ LIB1FILES+= $(SLB)$/dll.lib
#SOLARLIBDIR=..\$(INPATH)\lib
# bei lokalen osl rtl oder vos das SOLARLIBDIR bitte patchen !
LIB1FILES+= $(SOLARLIBDIR)\xosl.lib \
$(SOLARLIBDIR)\xrtl.lib \
$(SOLARLIBDIR)\xvos.lib
$(SOLARLIBDIR)\xrtl.lib
SHL1STDLIBS+= $(WSOCK32LIB)
.ENDIF
.ENDIF # "$(BIG_TOOLS)"!=""
......@@ -107,7 +107,7 @@ SHL1LIBS= $(LIB1TARGET)
SHL1DEF= $(MISC)$/$(SHL1TARGET).def
SHL1IMPLIB= itools
SHL1USE_EXPORTS=name
SHL1STDLIBS+= $(SALLIB) $(VOSLIB) $(BASEGFXLIB) $(I18NISOLANGLIB) $(COMPHELPERLIB)
SHL1STDLIBS+= $(SALLIB) $(BASEGFXLIB) $(I18NISOLANGLIB) $(COMPHELPERLIB)
.IF "$(GUI)"=="WNT"
SHL1STDLIBS+= $(SHELL32LIB) \
......
......@@ -53,9 +53,9 @@ APP1LIBS = $(LB)$/itools.lib
APP2TARGET = urltest
APP2OBJS = $(OBJ)$/urltest.obj
.IF "$(GUI)" == "UNX" || "$(GUI)" == "OS2"
APP2STDLIBS = $(TOOLSLIB) $(VOSLIB) $(SALLIB) $(CPPULIB) $(CPPUHELPERLIB)
APP2STDLIBS = $(TOOLSLIB) $(SALLIB) $(CPPULIB) $(CPPUHELPERLIB)
.ELSE
APP2STDLIBS = $(LB)$/itools.lib $(VOSLIB) $(SALLIB) $(CPPULIB) $(CPPUHELPERLIB)
APP2STDLIBS = $(LB)$/itools.lib $(SALLIB) $(CPPULIB) $(CPPUHELPERLIB)
.ENDIF
APP3TARGET = inetmimetest
......@@ -73,17 +73,17 @@ APP3STDLIBS = $(SALLIB) $(TOOLSLIB)
# APP4TARGET = demostor
# APP4OBJS = $(OBJ)$/demostor.obj
# .IF "$(GUI)" == "UNX"
# APP4STDLIBS = $(TOOLSLIB) $(VOSLIB) $(SALLIB)
# APP4STDLIBS = $(TOOLSLIB) $(SALLIB)
# .ELSE
# APP4STDLIBS = $(LB)$/itools.lib $(VOSLIB) $(SALLIB)
# APP4STDLIBS = $(LB)$/itools.lib $(SALLIB)
# .ENDIF
# APP5TARGET = fstest
# APP5OBJS = $(OBJ)$/fstest.obj
# .IF "$(GUI)" == "UNX"
# APP5STDLIBS = $(TOOLSLIB) $(VOSLIB) $(SALLIB)
# APP5STDLIBS = $(TOOLSLIB) $(SALLIB)
# .ELSE
# APP5STDLIBS = $(LB)$/itools.lib $(VOSLIB) $(SALLIB)
# APP5STDLIBS = $(LB)$/itools.lib $(SALLIB)
# .ENDIF
.INCLUDE: target.mk
......@@ -63,7 +63,6 @@ SHL1STDLIBS= \
$(CPPULIB) \
$(I18NISOLANGLIB) \
$(TOOLSLIB) \
$(VOSLIB) \
$(SALLIB)
SHL1LIBS=$(LIB1TARGET)
......
......@@ -52,7 +52,6 @@ APP1STDLIBS= $(CPPULIB) \
$(CPPUHELPERLIB) \
$(TOOLSLIB) \
$(SALLIB) \
$(VOSLIB) \
$(SOTLIB) \
$(COMPHELPERLIB) \
$(VCLLIB)
......
......@@ -54,7 +54,6 @@ SHL1STDLIBS=\
$(BASEBMPLIB)\
$(BASEGFXLIB)\
$(TOOLSLIB) \
$(VOSLIB) \
$(SALLIB)
.ENDIF # GUIBASE unx
......
......@@ -176,7 +176,6 @@ SHL1STDLIBS+=\
$(UCBHELPERLIB) \
$(CPPUHELPERLIB) \
$(CPPULIB) \
$(VOSLIB) \
$(SALLIB) \
$(BASEGFXLIB) \
$(ICUUCLIB) \
......@@ -301,7 +300,6 @@ SHL2STDLIBS=\
$(I18NPAPERLIB) \
$(I18NISOLANGLIB) \
$(TOOLSLIB) \
$(VOSLIB) \
$(BASEGFXLIB) \
$(UNOTOOLSLIB) \
$(COMPHELPERLIB) \
......@@ -381,7 +379,6 @@ SHL4STDLIBS+=\
$(TOOLSLIB) \
$(CPPUHELPERLIB) \
$(CPPULIB) \
$(VOSLIB) \
$(SALLIB) \
$(X11LINK_DYNAMIC)
......@@ -410,7 +407,6 @@ SHL5STDLIBS+=-l$(SHL2TARGET)
SHL5STDLIBS+=\
$(VCLLIB) \
$(TOOLSLIB) \
$(VOSLIB) \
$(SALLIB) \
$(X11LINK_DYNAMIC)
......@@ -440,7 +436,6 @@ SHL6STDLIBS+=\
$(VCLLIB) \
$(PSPLIB) \
$(TOOLSLIB) \
$(VOSLIB) \
$(SALLIB) \
$(X11LINK_DYNAMIC)
......
......@@ -60,7 +60,6 @@ APP1STDLIBS= $(CPPULIB) \
$(COMPHELPERLIB) \
$(TOOLSLIB) \
$(SALLIB) \
$(VOSLIB) \
$(SOTLIB) \
$(VCLLIB)
......@@ -92,7 +91,6 @@ APP3STDLIBS= $(CPPULIB) \
$(COMPHELPERLIB) \
$(TOOLSLIB) \
$(SALLIB) \
$(VOSLIB) \
$(SOTLIB) \
$(VCLLIB)
......@@ -110,7 +108,6 @@ APP4STDLIBS= $(CPPULIB) \
$(VCLLIB) \
$(TOOLSLIB) \
$(SALLIB) \
$(VOSLIB) \
$(SOTLIB) \
$(VCLLIB)
......@@ -125,7 +122,6 @@ APP5STDLIBS= $(CPPULIB) \
$(VCLLIB) \
$(TOOLSLIB) \
$(SALLIB) \
$(VOSLIB) \
$(SOTLIB) \
$(VCLLIB)
......
<html><head><TITLE></TITLE></head>
<body>
<H2><A HREF ="#DOC.DOCU" > <IMG BORDER=0 SRC=down.gif></A> </H2>
<TABLE>
<TR><TD VALIGN=top><IMG BORDER=0 SRC=icon1.gif> </TD><TD><A HREF=IAcceptHandler.html><B>IAcceptHandler</B></A> <br>
<I>Interface IAcceptHandler
Overload onConnection() to handle a connected socket</I>
</TD></TR><TR><TD VALIGN=top><IMG BORDER=0 SRC=icon1.gif> </TD><TD><A HREF=IAcceptHandlerFactory.html><B>IAcceptHandlerFactory</B></A> <br>
<I>Interface IAcceptHandlerFactory
Creates objects with IAcceptHandler interface</I>
</TD></TR><TR><TD VALIGN=top><IMG BORDER=0 SRC=icon1.gif> </TD><TD><A HREF=OAcceptor.html><B>OAcceptor</B></A> <br>
<I>Starts a thread where incoming connections are accepted</I>
</TD></TR><TR><TD VALIGN=top><IMG BORDER=0 SRC=icon1.gif> </TD><TD><A HREF=OByteArray.html><B>OByteArray</B></A> <br>
<I>Array of bytes</I>
</TD></TR><TR><TD VALIGN=top><IMG BORDER=0 SRC=icon1.gif> </TD><TD><A HREF=OByteStream.html><B>OByteStream</B></A> <br>
<I>Wraps a byte-stream around a byte array</I>
</TD></TR><TR><TD VALIGN=top><IMG BORDER=0 SRC=icon1.gif> </TD><TD><A HREF=ICondition.html><B>ICondition</B></A> <br>
<I>ICondition
Interface for a thread-spanning condition</I>
</TD></TR><TR><TD VALIGN=top><IMG BORDER=0 SRC=icon1.gif> </TD><TD><A HREF=OCondition.html><B>OCondition</B></A> <br>
<I>OCondition
Implements the ICondition interface</I>
</TD></TR><TR><TD VALIGN=top><IMG BORDER=0 SRC=icon1.gif> </TD><TD><A HREF=IConnectHandler.html><B>IConnectHandler</B></A> <br>
<I>Interface IConnectHandler</I>
</TD></TR><TR><TD VALIGN=top><IMG BORDER=0 SRC=icon1.gif> </TD><TD><A HREF=OConnector.html><B>OConnector</B></A> <br>
<I>Delegates a connected socket to an IConnectHandler object</I>
</TD></TR><TR><TD VALIGN=top><IMG BORDER=0 SRC=icon1.gif> </TD><TD><A HREF=OException.html><B>OException</B></A> <br>
<I>Base class for exceptions</I>
</TD></TR><TR><TD VALIGN=top><IMG BORDER=0 SRC=icon1.gif> </TD><TD><A HREF=OSimpleException.html><B>OSimpleException</B></A> <br>
<I></I>
</TD></TR><TR><TD VALIGN=top><IMG BORDER=0 SRC=icon1.gif> </TD><TD><A HREF=IExecutable.html><B>IExecutable</B></A> <br>
<I>IExecutable
The IExecutable-interface is to be understood as wrapper around
your application-code, which allows it to be executed asynchronously</I>
</TD></TR><TR><TD VALIGN=top><IMG BORDER=0 SRC=icon1.gif> </TD><TD><A HREF=OExecutable.html><B>OExecutable</B></A> <br>
<I>OExecutable
added default impl</I>
</TD></TR><TR><TD VALIGN=top><IMG BORDER=0 SRC=icon1.gif> </TD><TD><A HREF=OFiberingServer.html><B>OFiberingServer</B></A> <br>
<I>OFiberingServer
Depends on cooperative executing IExecutable-Objects</I>
</TD></TR><TR><TD VALIGN=top><IMG BORDER=0 SRC=icon1.gif> </TD><TD><A HREF=OFuture.html><B>OFuture</B></A> <br>
<I>OFuture, OFutureRef
A future represents the result of an asynchronous operation</I>
</TD></TR><TR><TD VALIGN=top><IMG BORDER=0 SRC=icon1.gif> </TD><TD><A HREF=OFutureRef.html><B>OFutureRef</B></A> <br>
<I>OFutureRef
</I>
</TD></TR><TR><TD VALIGN=top><IMG BORDER=0 SRC=icon1.gif> </TD><TD><A HREF=IStream.html><B>IStream</B></A> <br>
<I>Interface for a stream of data, on that you can read and write blocks of bytes</I>
</TD></TR><TR><TD VALIGN=top><IMG BORDER=0 SRC=icon1.gif> </TD><TD><A HREF=IMutex.html><B>IMutex</B></A> <br>
<I>IMutex interface
</I>
</TD></TR><TR><TD VALIGN=top><IMG BORDER=0 SRC=icon1.gif> </TD><TD><A HREF=OThreadMutex.html><B>OThreadMutex</B></A> <br>
<I>OThreadMutex
</I>
</TD></TR><TR><TD VALIGN=top><IMG BORDER=0 SRC=icon1.gif> </TD><TD><A HREF=OGuard.html><B>OGuard</B></A> <br>
<I>OGuard
</I>
</TD></TR><TR><TD VALIGN=top><IMG BORDER=0 SRC=icon1.gif> </TD><TD><A HREF=OObject.html><B>OObject</B></A> <br>
<I>OObject
common base class for all framework classes</I>
</TD></TR><TR><TD VALIGN=top><IMG BORDER=0 SRC=icon1.gif> </TD><TD><A HREF=OCreateParam.html><B>OCreateParam</B></A> <br>
<I>
Basic class information</I>
</TD></TR><TR><TD VALIGN=top><IMG BORDER=0 SRC=icon1.gif> </TD><TD><A HREF=OClassInfo.html><B>OClassInfo</B></A> <br>
<I></I>
</TD></TR><TR><TD VALIGN=top><IMG BORDER=0 SRC=icon1.gif> </TD><TD><A HREF=IObserver.html><B>IObserver</B></A> <br>
<I>IObserver
</I>
</TD></TR><TR><TD VALIGN=top><IMG BORDER=0 SRC=icon1.gif> </TD><TD><A HREF=IObserved.html><B>IObserved</B></A> <br>
<I>IObserved
Just an idea</I>
</TD></TR><TR><TD VALIGN=top><IMG BORDER=0 SRC=icon1.gif> </TD><TD><A HREF=OObserver.html><B>OObserver</B></A> <br>
<I>OObserver
add default-implementation of refence-counting behaviour to IObserver-Interface
</I>
</TD></TR><TR><TD VALIGN=top><IMG BORDER=0 SRC=icon1.gif> </TD><TD><A HREF=ORef.html><B>ORef</B></A> <br>
<I>
ORef<T>
template type to implement handle/body behaviour
with reference-counting</I>
</TD></TR><TR><TD VALIGN=top><IMG BORDER=0 SRC=icon1.gif> </TD><TD><A HREF=IReferenceCounter.html><B>IReferenceCounter</B></A> <br>
<I>Interface for refernce-counting</I>
</TD></TR><TR><TD VALIGN=top><IMG BORDER=0 SRC=icon1.gif> </TD><TD><A HREF=IRunnable.html><B>IRunnable</B></A> <br>
<I>IRunnable
The IRunnable-interface is to be understood as wrapper around
your application-code, which allows it to be executed asynchronously</I>
</TD></TR><TR><TD VALIGN=top><IMG BORDER=0 SRC=icon1.gif> </TD><TD><A HREF=OExecutableThread.html><B>OExecutableThread</B></A> <br>
<I>OExecutableThread
A thread used to execute an IExecutable-Object</I>
</TD></TR><TR><TD VALIGN=top><IMG BORDER=0 SRC=icon1.gif> </TD><TD><A HREF=OSemaphore.html><B>OSemaphore</B></A> <br>
<I>Counting semaphore (unnamed, because thread-local)</I>
</TD></TR><TR><TD VALIGN=top><IMG BORDER=0 SRC=icon1.gif> </TD><TD><A HREF=ISocketTypes.html><B>ISocketTypes</B></A> <br>
<I>Base data types</I>
</TD></TR><TR><TD VALIGN=top><IMG BORDER=0 SRC=icon1.gif> </TD><TD><A HREF=ISocketAddr.html><B>ISocketAddr</B></A> <br>
<I>Base class for socket addresses</I>
</TD></TR><TR><TD VALIGN=top><IMG BORDER=0 SRC=icon1.gif> </TD><TD><A HREF=OInetSocketAddr.html><B>OInetSocketAddr</B></A> <br>
<I>Represents an internet-address</I>
</TD></TR><TR><TD VALIGN=top><IMG BORDER=0 SRC=icon1.gif> </TD><TD><A HREF=OIpxSocketAddr.html><B>OIpxSocketAddr</B></A> <br>
<I>Represents an IPX/SPX address</I>
</TD></TR><TR><TD VALIGN=top><IMG BORDER=0 SRC=icon1.gif> </TD><TD><A HREF=OSocket.html><B>OSocket</B></A> <br>
<I>Represents a socket</I>
</TD></TR><TR><TD VALIGN=top><IMG BORDER=0 SRC=icon1.gif> </TD><TD><A HREF=OStreamSocket.html><B>OStreamSocket</B></A> <br>
<I>A socket to send or receive a stream of data</I>
</TD></TR><TR><TD VALIGN=top><IMG BORDER=0 SRC=icon1.gif> </TD><TD><A HREF=OAcceptorSocket.html><B>OAcceptorSocket</B></A> <br>
<I>A socket to accept incoming connections</I>
</TD></TR><TR><TD VALIGN=top><IMG BORDER=0 SRC=icon1.gif> </TD><TD><A HREF=OConnectorSocket.html><B>OConnectorSocket</B></A> <br>
<I>A socket to initiate a conenction</I>
</TD></TR><TR><TD VALIGN=top><IMG BORDER=0 SRC=icon1.gif> </TD><TD><A HREF=ODatagramSocket.html><B>ODatagramSocket</B></A> <br>
<I>A connectionless socket to send and receive datagrams</I>
</TD></TR><TR><TD VALIGN=top><IMG BORDER=0 SRC=icon1.gif> </TD><TD><A HREF=IPositionableStream.html><B>IPositionableStream</B></A> <br>
<I>Adds seeking capabilities to IStream</I>
</TD></TR><TR><TD VALIGN=top><IMG BORDER=0 SRC=icon1.gif> </TD><TD><A HREF=OStream.html><B>OStream</B></A> <br>
<I>Implements IPositionableStream</I>
</TD></TR><TR><TD VALIGN=top><IMG BORDER=0 SRC=icon1.gif> </TD><TD><A HREF=OString.html><B>OString</B></A> <br>
<I>A string class</I>
</TD></TR>
</TABLE>
<A NAME="DOC.DOCU">
<DL></DL><P><I><A HREF="aindex.html"> alphabetic index</A></I> <I><A HREF="HIER.html"> hierarchy of classes</A></I><P></BODY><hr>
<A HREF="http://www.zib.de/Visual/software/doc++/index.html"><IMG BORDER=0 ALIGN=RIGHT SRC=logo.gif></A>
<P Align=Center><I>this page has been generated automatically by doc++
<P Align=Center>(c)opyright by <A HREF="http://www.zib.de/zoeckler/"> Malte Z&oumlckler</A>, <A HREF="mailto:wunderling@zib.de"> Roland Wunderling </A><br>contact: <A HREF="mailto:doc++@zib.de"> doc++@zib.de </a>
\ No newline at end of file
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
*
* OpenOffice.org 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 Lesser General Public License version 3 for more details
* (a copy is included in the LICENSE file that accompanied this code).
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with OpenOffice.org. If not, see
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
*
************************************************************************/
#ifndef _VOS_EXECABL_HXX_
#define _VOS_EXECABL_HXX_
# include <vos/types.hxx>
# include <vos/refernce.hxx>
namespace vos
{
/** IExecutable
The IExecutable-interface is to be understood as wrapper around
your application-code, which allows it to be executed asynchronously.
Wether you want real asynchronous behaviour or just pseudo-multitasking
depends on which kind of execution-service you use to execute your executable.
(E.g. Threadpool/Fiberpool)
@author Bernd Hofner
@version 0.1
*/
class IExecutable : public NAMESPACE_VOS(IReference)
{
public:
/** Overload to implement your functionality.
Return True, if you want "execute()" to be called again.
*/
virtual sal_Bool SAL_CALL execute()= 0;
/** If you use blocking calls within your execute-function,
you should provide here a means to unblock cleanly.
@Return False if you are not able to unblock the
thread.
*/
virtual sal_Bool SAL_CALL unblock()= 0;
/**
STL demands this operators if you want to place
IExecutables per value in collections.
*/
virtual sal_Bool SAL_CALL operator<(const IExecutable&) const= 0;
virtual sal_Bool SAL_CALL operator>(const IExecutable&) const= 0;
virtual sal_Bool SAL_CALL operator==(const IExecutable&) const= 0;
virtual sal_Bool SAL_CALL operator!=(const IExecutable&) const= 0;
};
/** OExecutable
added default impl. of IReferenceCounter
*/
class OExecutable : public NAMESPACE_VOS(IExecutable),
public NAMESPACE_VOS(OReference)
{
public:
virtual ~OExecutable()
{
}
/*
Since the dominance of the OReferenceCounter impl.
of the IReferenceCounter is not granted, delegate
the methods to this branch of the diamond-shaped
inheritance tree.
*/
virtual RefCount SAL_CALL acquire()
{
return OReference::acquire();
}
virtual RefCount SAL_CALL release()
{
return OReference::release();
}
virtual RefCount SAL_CALL referenced() const
{
return OReference::referenced();
}
/** Default implementation of unblock does nothing.
*/
virtual sal_Bool SAL_CALL unblock() { return sal_True; }
/**
STL demands this operators if you want to place
IExecutables per value in collections.
Use a default implementation of the comparison-operators
here without a correct semantic.
*/
virtual sal_Bool SAL_CALL operator<(const IExecutable&) const
{
return sal_False;
}
virtual sal_Bool SAL_CALL operator>(const IExecutable&) const
{
return sal_False;
}
virtual sal_Bool SAL_CALL operator==(const IExecutable&) const
{
return sal_True;
}
virtual sal_Bool SAL_CALL operator!=(const IExecutable&) const
{
return sal_False;
}
};
}
#endif // _VOS_EXECABL_HXX_
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
*
* OpenOffice.org 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 Lesser General Public License version 3 for more details
* (a copy is included in the LICENSE file that accompanied this code).
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with OpenOffice.org. If not, see
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
*
************************************************************************/
#ifndef _VOS_ISTREAM_HXX_
#define _VOS_ISTREAM_HXX_
#include "sal/types.h"
# include <vos/types.hxx>
namespace vos
{
/** Interface for a stream of data, on that you can read and write blocks of bytes.
*/
class IStream
{
public:
IStream() { }
virtual ~IStream() { }
/** Retrieve n bytes from the stream and copy them into pBuffer.
@param pBuffer receives the read data.
@param n the number of bytes to read. pBuffer must be large enough
to hold the n bytes!
@return the number of read bytes
*/
virtual sal_Int32 SAL_CALL read(void* pBuffer,
sal_uInt32 n) const= 0;
/** Write n bytes from pBuffer to the stream.
@param pBuffer contains the data to be written.
@param n the number of bytes to write.
@return the number of written bytes
*/
virtual sal_Int32 SAL_CALL write(const void* pBuffer,
sal_uInt32 n)= 0;
/** Checks if stream is closed for further reading.
@return True is stream has ended (e.g. was closed).
*/
virtual sal_Bool SAL_CALL isEof() const = 0;
};
}
#endif // _VOS_ISTREAM_HXX_
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
*
* OpenOffice.org 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 Lesser General Public License version 3 for more details
* (a copy is included in the LICENSE file that accompanied this code).
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with OpenOffice.org. If not, see
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
*
************************************************************************/
#ifndef _VOS_MACROS_HXX_
#define _VOS_MACROS_HXX_
#include <osl/endian.h>
// *********************************************************************
// Macro definitions
#ifndef VOS_CAST
# define VOS_CAST(type,value) (*((type*)&(value)))
#endif
#ifndef VOS_UNUSED
# define VOS_UNUSED(x) (x=x)
#endif
#ifndef VOS_FOREVER
# define VOS_FOREVER for(;;)
#endif
#ifndef VOS_MAX
# define VOS_MAX(a,b) (((a) > (b)) ? (a) : (b))
#endif
#ifndef VOS_MIN
# define VOS_MIN(a,b) (((a) < (b)) ? (a) : (b))
#endif
#ifndef VOS_ABS
# define VOS_ABS(a) (((a) < 0) ? (-(a)) : (a))
#endif
#ifndef VOS_SIGN
# define VOS_SIGN(a) ( ((a) < 0) ? (-1) : (((a) > 0) ? (1) : (0)) )
#endif
#ifndef VOS_BOUND
# define VOS_BOUND(x,l,h) ((x) <= (l) ? (l) : ((x) >= (h) ? (h) : (x)))
#endif
#ifndef VOS_SWAP
# define VOS_SWAP(a,b) ((a) ^= (b) ^= (a) ^= (b))
#endif
#ifndef VOS_BYTEBOUND
# define VOS_BYTEBOUND(a) (((a) + 7) / 8)
#endif
#ifndef VOS_WORDBOUND
# define VOS_WORDBOUND(a) ((((a) + 15) / 16) * 2)
#endif
#ifndef VOS_DWORDBOUND
# define VOS_DWORDBOUND(a) ((((a) + 31) / 32) * 4)
#endif
#ifndef VOS_MAKEDWORD
# define VOS_MAKEDWORD(wl, wh) ((sal_uInt32)((wl) & 0xFFFF) | (((sal_uInt32)(wh) & 0xFFFF) << 16))
#endif
#ifndef VOS_LOWORD
# define VOS_LOWORD(d) ((sal_uInt16)((sal_uInt32)(d) & 0xFFFF))
#endif
#ifndef VOS_HIWORD
# define VOS_HIWORD(d) ((sal_uInt16)(((sal_uInt32)(d) >> 16) & 0xFFFF))
#endif
#ifndef VOS_MAKEWORD
# define VOS_MAKEWORD(bl, bh) ((sal_uInt16)((bl) & 0xFF) | (((sal_uInt16)(bh) & 0xFF) << 8))
#endif
#ifndef VOS_LOBYTE
# define VOS_LOBYTE(w) ((sal_uInt8)((sal_uInt16)(w) & 0xFF))
#endif
#ifndef VOS_HIBYTE
# define VOS_HIBYTE(w) ((sal_uInt8)(((sal_uInt16)(w) >> 8) & 0xFF))
#endif
#ifndef VOS_MAKEBYTE
# define VOS_MAKEBYTE(nl, nh) ((sal_uInt8)(((nl) & 0x0F) | (((nh) & 0x0F) << 4)))
#endif
#ifndef VOS_LONIBBLE
# define VOS_LONIBBLE(b) ((sal_uInt8)((b) & 0x0F))
#endif
#ifndef VOS_HINIBBLE
# define VOS_HINIBBLE(b) ((sal_uInt8)(((b) >> 4) & 0x0F))
#endif
#ifndef VOS_SWAPWORD
# define VOS_SWAPWORD(w) VOS_MAKEWORD(VOS_HIBYTE(w),VOS_LOBYTE(w))
#endif
#ifndef VOS_SWAPDWORD
# define VOS_SWAPDWORD(d) VOS_MAKEDWORD(VOS_SWAPWORD(VOS_HIWORD(d)),VOS_SWAPWORD(VOS_LOWORD(d)))
#endif
#ifdef OSL_BIGENDIAN
#ifndef VOS_NETWORD
# define VOS_NETWORD(w) (sal_uInt16)(w)
#endif
#ifndef VOS_NETDWORD
# define VOS_NETDWORD(d) (sal_uInt32)(d)
#endif
#else // OSL_LITENDIAN
#ifndef VOS_NETWORD
# define VOS_NETWORD(w) VOS_MAKEWORD(VOS_HIBYTE(w),VOS_LOBYTE(w))
#endif
#ifndef VOS_NETDWORD
# define VOS_NETDWORD(d) VOS_MAKEDWORD(VOS_NETWORD(VOS_HIWORD(d)),VOS_NETWORD(VOS_LOWORD(d)))
#endif
#endif // OSL_BIGENDIAN
#ifdef _OSL_MEMSEG
# define VOS_MAKEPTR(base, off) ((void _far *)VOS_MAKEDWORD((off), (base)))
# define VOS_BASEOF(ptr) VOS_HIWORD(ptr)
# define VOS_OFSTOF(ptr) VOS_LOWORD(ptr)
#else
# define VOS_MAKEPTR(base, off) ((void *)((base) + (off)))
# define VOS_BASEOF(ptr) (ptr)
# define VOS_OFSTOF(ptr) 0
#endif
#ifndef VOS_FIELDOFFSET
# define VOS_FIELDOFFSET(type, field) ((sal_Int32)(&((type *)1)->field) - 1)
#endif
// def. for arbitrary namespace
#define VOS_NAMESPACE(class_name, name_space) name_space::class_name
// sal_Int16 def. for namespace vos
#define NAMESPACE_VOS(class_name) vos::class_name
// sal_Int16 def. for namespace std
#define NAMESPACE_STD(class_name) std::class_name
#endif //_VOS_MACROS_HXX_
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
*
* OpenOffice.org 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 Lesser General Public License version 3 for more details
* (a copy is included in the LICENSE file that accompanied this code).
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with OpenOffice.org. If not, see
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
*
************************************************************************/
#ifndef _VOS_OBJECT_HXX_
#define _VOS_OBJECT_HXX_
# include <vos/types.hxx>
# include <vos/macros.hxx>
namespace vos
{
// ***************************************
// Object super class
struct OClassInfo;
struct OCreateParam;
/** OObject
common base class for all framework classes. Used for memory-management
and runtime type-info.
*/
class OObject
{
public:
///
OObject();
///
OObject(const OCreateParam& rParam);
// Disable the copy constructor and assignment by default so you will get
// compiler errors instead of unexpected behaviour if you pass objects
// by value or assign objects.
private:
OObject(const OObject& objectSrc); // no implementation
void SAL_CALL operator=(const OObject& objectSrc); // no implementation
public:
virtual ~OObject();
public:
/** Define private new and delete operator because of compiler bug,
when allocating and deleteing a exported class
*/
void* SAL_CALL operator new(::size_t size);
void* SAL_CALL operator new(::size_t size, void* p);
void SAL_CALL operator delete(void* p);
// Attributes
public:
///
virtual const OClassInfo& SAL_CALL getClassInfo() const;
///
sal_Bool SAL_CALL isKindOf(const OClassInfo& rClass) const;
// Implementation
public:
static const OClassInfo& SAL_CALL classInfo();
public:
static OClassInfo __ClassInfo__;
};
/**
Basic class information
*/
struct OCreateParam
{
sal_uInt32 m_Size;
void* m_pParam;
///
OCreateParam(void *pParam)
{
m_Size = sizeof(OCreateParam);
m_pParam = pParam;
}
};
/**
*/
struct OClassInfo
{
///
const sal_Char *m_pClassName;
///
sal_Int32 m_nObjectSize;
/// schema number of the loaded class
sal_uInt32 m_wSchema;
///
OObject* (SAL_CALL * m_pfnCreateObject)(const OCreateParam&); // NULL => abstract class
/// linked list of registered classes
const OClassInfo* m_pBaseClass;
/// linked list of registered classes
const OClassInfo* m_pNextClass;
///
OObject* SAL_CALL createObject(const OCreateParam& rParam) const;
///
sal_Bool SAL_CALL isDerivedFrom(const OClassInfo& rBaseClass) const;
///
static const OClassInfo* SAL_CALL getClassInfo(const sal_Char* pClassName);
///
OClassInfo(const sal_Char *pClassName, sal_Int32 ObjectSize,
const OClassInfo* pBaseClass = NULL, sal_uInt32 Schema = (sal_uInt32)-1,
OObject* (SAL_CALL * fnCreateObject)(const OCreateParam&) = NULL);
};
// *****************************************************************
// Helper macros for declaring OClassInfo data
#define VOS_STRINGIZE(name) #name
#define VOS_CLASSNAME(class_name, domain_name) VOS_STRINGIZE(domain_name.class_name)
#define VOS_CLASSINFO(class_name) (class_name::classInfo())
// generate static object constructor for class registration
struct VOS_CLASSINIT
{ VOS_CLASSINIT(VOS_NAMESPACE(OClassInfo, vos)* pNewClass); };
#define VOS_CLASSDATA(class_spec, class_name, base_class_name, wSchema, constructor) \
VOS_NAMESPACE(OClassInfo, vos) class_name::__ClassInfo__(class_spec, \
sizeof(class_name), &VOS_CLASSINFO(base_class_name), wSchema, constructor); \
const VOS_NAMESPACE(VOS_CLASSINIT, vos) class_name::__ClassInit__(&class_name::__ClassInfo__); \
const VOS_NAMESPACE(OClassInfo, vos)& SAL_CALL class_name::getClassInfo() const \
{ return (VOS_CLASSINFO(class_name)); } \
const VOS_NAMESPACE(OClassInfo, vos)& SAL_CALL class_name::classInfo() \
{ return (__ClassInfo__); }
#define VOS_DECLARE_CLASSINFO(class_name) \
public: \
static const VOS_NAMESPACE(VOS_CLASSINIT, vos) __ClassInit__; \
static VOS_NAMESPACE(OClassInfo, vos) __ClassInfo__; \
public: \
virtual const VOS_NAMESPACE(OClassInfo, vos)& SAL_CALL getClassInfo() const; \
static const VOS_NAMESPACE(OClassInfo, vos)& SAL_CALL classInfo()
#define VOS_IMPLEMENT_CLASSINFO(class_spec, class_name, base_class_name, wSchema) \
VOS_CLASSDATA(class_spec, class_name, base_class_name, wSchema, NULL)
#define VOS_DECLARE_CLASSTYPE(class_name) \
VOS_DECLARE_CLASSINFO(class_name); \
public: \
static VOS_NAMESPACE(OObject, vos)* SAL_CALL createObject(const VOS_NAMESPACE(OCreateParam, vos)& rParam);
#define VOS_IMPLEMENT_CLASSTYPE(class_spec, class_name, base_class_name, wSchema) \
VOS_CLASSDATA(class_spec, class_name, base_class_name, wSchema, class_name::createObject) \
VOS_NAMESPACE(OObject, vos)* class_name::createObject(const VOS_NAMESPACE(OCreateParam, vos)& rParam) \
{ return new class_name(rParam); }
}
#endif // _VOS_OBJECT_HXX_
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
This diff is collapsed.
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
*
* OpenOffice.org 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 Lesser General Public License version 3 for more details
* (a copy is included in the LICENSE file that accompanied this code).
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with OpenOffice.org. If not, see
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
*
************************************************************************/
#if (defined(OS2) && defined(ICC))
#define CAST_TO_IREFERENCE(p) ((IReference*)(p))
#else
#define CAST_TO_IREFERENCE(p) (p)
#endif
template <class T>
inline ORef<T>::ORef()
{
m_refBody= 0;
}
template <class T>
inline ORef<T>::ORef(T* pBody)
{
m_refBody= pBody;
if (m_refBody)
CAST_TO_IREFERENCE(m_refBody)->acquire();
}
template <class T>
inline ORef<T>::ORef(const ORef<T>& handle)
{
m_refBody= handle.m_refBody;
if (m_refBody)
CAST_TO_IREFERENCE(m_refBody)->acquire();
}
template <class T>
inline ORef<T>::~ORef()
{
if (m_refBody)
CAST_TO_IREFERENCE(m_refBody)->release();
}
template <class T>
inline ORef<T>& ORef<T>::operator= (const ORef<T>& handle)
{
if (m_refBody)
CAST_TO_IREFERENCE(m_refBody)->release();
m_refBody= handle.m_refBody;
if (m_refBody)
CAST_TO_IREFERENCE(m_refBody)->acquire();
return *this;
}
template <class T>
inline void ORef<T>::bind(T* pBody)
{
if (m_refBody)
CAST_TO_IREFERENCE(m_refBody)->release();
m_refBody= pBody;
if (m_refBody)
CAST_TO_IREFERENCE(m_refBody)->acquire();
}
template <class T>
inline ORef<T>& ORef<T>::unbind()
{
if (m_refBody)
{
CAST_TO_IREFERENCE(m_refBody)->release();
m_refBody = 0;
}
return *this;
}
template <class T>
inline void ORef<T>::operator= (T* pBody)
{
bind(pBody);
}
template <class T>
inline T& ORef<T>::operator() () const
{
OSL_PRECOND(m_refBody, "ORef::operator(): can't deref nil body!");
return *m_refBody;
}
template <class T>
inline T& ORef<T>::operator* () const
{
OSL_PRECOND(m_refBody, "ORef::operator*: can't deref nil body!");
return *m_refBody;
}
template <class T>
inline T* ORef<T>::operator->() const
{
OSL_PRECOND(m_refBody, "ORef::operator->: nil body!");
return m_refBody;
}
template <class T>
inline T& ORef<T>::getBody() const
{
OSL_PRECOND(m_refBody, "ORef::getBody(): can't deref nil body!");
return *m_refBody;
}
template <class T>
inline T* ORef<T>::getBodyPtr() const
{
// might be nil
return m_refBody;
}
template <class T>
inline sal_Bool ORef<T>::isEmpty() const
{
return m_refBody == 0;
}
template <class T>
inline sal_Bool ORef<T>::isValid() const
{
return m_refBody != 0;
}
template <class T>
inline sal_Bool ORef<T>::isEqualBody(const ORef<T>& handle) const
{
return m_refBody == handle.m_refBody;
}
template <class T>
inline sal_Bool ORef<T>::operator== (const ORef<T>& handle) const
{
return m_refBody == handle.m_refBody;
}
template <class T>
inline sal_Bool ORef<T>::operator!= (const ORef<T>& handle) const
{
return m_refBody != handle.m_refBody;
}
template <class T>
inline sal_Bool ORef<T>::operator== (const T* pBody) const
{
return m_refBody == pBody;
}
template <class T>
inline sal_Bool ORef<T>::operator< (const ORef<T>& handle) const
{
return m_refBody < handle.m_refBody;
}
template <class T>
inline sal_Bool ORef<T>::operator> (const ORef<T>& handle) const
{
return m_refBody > handle.m_refBody;
}
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
*
* OpenOffice.org 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 Lesser General Public License version 3 for more details
* (a copy is included in the LICENSE file that accompanied this code).
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with OpenOffice.org. If not, see
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
*
************************************************************************/
#ifndef _VOS_REFERNCE_HXX_
#define _VOS_REFERNCE_HXX_
# include <vos/types.hxx>
# include <osl/interlck.h>
# include <vos/object.hxx>
namespace vos
{
/** Interface for refernce-counting
*/
class IReference
{
public:
IReference() { }
virtual ~IReference() { }
typedef oslInterlockedCount RefCount;
virtual RefCount SAL_CALL acquire()=0;
virtual RefCount SAL_CALL release()=0;
virtual RefCount SAL_CALL referenced() const=0;
};
class ORefCount
{
public:
typedef IReference::RefCount RefCount;
ORefCount() { m_RefCount = 0; }
ORefCount(RefCount n) { m_RefCount = n; }
virtual ~ORefCount();
RefCount SAL_CALL acquire() { return (osl_incrementInterlockedCount(&m_RefCount)); };
RefCount SAL_CALL release() { return (osl_decrementInterlockedCount(&m_RefCount)); };
RefCount SAL_CALL operator++() { return acquire(); }
// don't implement the postfix operator, it won't function this way!
RefCount SAL_CALL operator--() { return release(); }
// don't implement the postfix operator, it won't function this way!
RefCount SAL_CALL referenced() const
{ return (m_RefCount); }
protected:
RefCount m_RefCount;
private:
// disable copy/assignment
ORefCount(const ORefCount&);
ORefCount& SAL_CALL operator= (const ORefCount&);
};
class OReference : public NAMESPACE_VOS(IReference)
{
public:
OReference();
virtual ~OReference();
virtual RefCount SAL_CALL acquire();
virtual RefCount SAL_CALL release();
virtual RefCount SAL_CALL referenced() const
{ return (m_RefCount.referenced()); }
protected:
ORefCount m_RefCount;
private:
// disable copy/assignment
OReference(const OReference&);
OReference& SAL_CALL operator= (const OReference&);
};
}
#endif // _VOS_REFERNCE_HXX_
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
*
* OpenOffice.org 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 Lesser General Public License version 3 for more details
* (a copy is included in the LICENSE file that accompanied this code).
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with OpenOffice.org. If not, see
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
*
************************************************************************/
#ifndef _VOS_REFOBJ_HXX_
#define _VOS_REFOBJ_HXX_
/**
ORefObj<T>
template type to implement handle/body behaviour
with reference-counting.
*/
#include <vos/refernce.hxx>
#include <osl/diagnose.h>
namespace vos
{
template <class T>
class ORefObj : public IReference
{
public:
ORefObj(const T& Obj);
inline ~ORefObj();
virtual RefCount SAL_CALL acquire()
{ return (m_RefCount.acquire()); }
virtual RefCount SAL_CALL release()
{ return (m_RefCount.release()); }
virtual RefCount SAL_CALL referenced() const
{ return (m_RefCount.referenced()); }
T& SAL_CALL operator=(const T& Obj);
SAL_CALL operator T&();
SAL_CALL operator const T&() const;
T& SAL_CALL operator() ();
const T& SAL_CALL operator() () const;
const T& SAL_CALL getObj() const;
T& SAL_CALL getObj();
protected:
T m_Obj;
ORefCount m_RefCount;
private:
ORefObj(const ORefObj<T>& handle);
ORefObj<T>& SAL_CALL operator= (const ORefObj<T>& handle);
};
// include template implementation
#include <vos/refobj.inl>
}
#endif // _VOS_REF_HXX_
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
*
* OpenOffice.org 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 Lesser General Public License version 3 for more details
* (a copy is included in the LICENSE file that accompanied this code).
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with OpenOffice.org. If not, see
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
*
************************************************************************/
template <class T>
ORefObj<T>::ORefObj(const T& Obj)
{
m_Obj = Obj;
m_RefCount.acquire();
}
template <class T>
inline ORefObj<T>::~ORefObj()
{
OSL_ASSERT(m_RefCount.referenced() == 0);
}
template <class T>
inline T& ORefObj<T>::operator=(const T& Obj)
{
m_Obj = Obj;
return m_Obj;
}
template <class T>
inline ORefObj<T>::operator T&()
{
return m_Obj;
}
template <class T>
inline ORefObj<T>::operator const T&() const
{
return m_Obj;
}
template <class T>
inline T& ORefObj<T>::operator() ()
{
return m_Obj;
}
template <class T>
inline const T& ORefObj<T>::operator() () const
{
return m_Obj;
}
template <class T>
inline T& ORefObj<T>::getObj()
{
return m_Obj;
}
template <class T>
inline const T& ORefObj<T>::getObj() const
{
return m_Obj;
}
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
*
* OpenOffice.org 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 Lesser General Public License version 3 for more details
* (a copy is included in the LICENSE file that accompanied this code).
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with OpenOffice.org. If not, see
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
*
************************************************************************/
#ifndef _VOS_RUNNABLE_HXX_
#define _VOS_RUNNABLE_HXX_
# include <vos/types.hxx>
# include <vos/refernce.hxx>
namespace vos
{
/** IRunnable
The IRunnable-interface is to be understood as wrapper around
your application-code, which allows it to be executed asynchronously.
@author Bernd Hofner
@version 0.1
*/
class IRunnable
{
public:
IRunnable() { }
virtual ~IRunnable() { }
/** overload to implement your functionality.
*/
virtual void SAL_CALL run()= 0;
};
}
#endif // _VOS_RUNNABLE_HXX_
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
*
* OpenOffice.org 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 Lesser General Public License version 3 for more details
* (a copy is included in the LICENSE file that accompanied this code).
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with OpenOffice.org. If not, see
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
*
************************************************************************/
#ifndef _VOS_STREAM_HXX_
#define _VOS_STREAM_HXX_
# include <vos/types.hxx>
# include <vos/object.hxx>
# include <vos/istream.hxx>
namespace vos
{
/** Adds seeking capabilities to IStream
*/
class IPositionableStream : public NAMESPACE_VOS(IStream)
{
public:
typedef sal_Int32 Offset;
public:
///
virtual sal_Bool SAL_CALL seekTo(Offset position) const = 0;
///
virtual sal_Bool SAL_CALL seekRelative(Offset change) const = 0;
///
virtual sal_Bool SAL_CALL seekToEnd() const = 0;
///
virtual sal_Bool SAL_CALL changeSize(sal_uInt32 new_size) = 0;
///
virtual sal_uInt32 SAL_CALL getSize() const = 0;
///
virtual Offset SAL_CALL getOffset() const = 0;
protected:
IPositionableStream() { }
virtual ~IPositionableStream() { }
};
/** Implements IPositionableStream
*/
class OStream : public NAMESPACE_VOS(OObject),
public NAMESPACE_VOS(IPositionableStream)
{
VOS_DECLARE_CLASSINFO(VOS_NAMESPACE(OStream, vos));
public:
///
OStream(IPositionableStream& rStream);
///
virtual ~OStream ();
// ----------------- Read operations -------------------------
///
virtual sal_Int32 SAL_CALL read(void* pbuffer, sal_uInt32 n) const;
///
sal_Int32 SAL_CALL read(IPositionableStream::Offset offset,
void* pbuffer,
sal_uInt32 n) const;
///
inline sal_Bool SAL_CALL read(sal_Int32& value) const;
///
inline sal_Bool SAL_CALL read(sal_Int16& value) const;
///
inline sal_Bool SAL_CALL read(sal_Char& value) const;
///
inline sal_Bool SAL_CALL read(sal_uInt8& value) const;
// ----------------- Write operations ------------------------
///
virtual sal_Int32 SAL_CALL write(const void* pbuffer, sal_uInt32 n);
///
sal_Int32 SAL_CALL write(IPositionableStream::Offset offset,
const void* pbuffer,
sal_uInt32 n);
///
inline sal_Bool SAL_CALL write(sal_Int32 value);
///
inline sal_Bool SAL_CALL write(sal_Int16 value);
///
inline sal_Bool SAL_CALL write(sal_Char value);
///
inline sal_Bool SAL_CALL write(sal_uInt8 value);
///
sal_Bool SAL_CALL append(void* pbuffer, sal_uInt32 n); // Write at the end of the Stream.
// ------------- Positioning and sizing operations ----------
///
inline sal_Bool SAL_CALL seekToBegin() const;
// ----------------- Stream interface ------------------------
///
virtual sal_Bool SAL_CALL seekTo(IPositionableStream::Offset pos) const;
///
virtual sal_Bool SAL_CALL seekToEnd() const;
///
virtual sal_Bool SAL_CALL seekRelative(IPositionableStream::Offset change) const;
///
virtual sal_Bool SAL_CALL changeSize(sal_uInt32 new_size);
///
virtual sal_uInt32 SAL_CALL getSize() const;
///
virtual sal_Bool SAL_CALL isEof() const;
///
virtual IPositionableStream::Offset SAL_CALL getOffset() const;
protected:
IPositionableStream& m_rStream;
// ----------------- Stream operators ------------------------
friend const OStream& operator>> (OStream& rStream, sal_Int32& value);
friend const OStream& operator>> (OStream& rStream, sal_Int16& value);
friend const OStream& operator>> (OStream& rStream, sal_uInt8& value);
friend const OStream& operator>> (OStream& rStream, sal_Char& value);
friend OStream& operator<< (OStream& rStream, sal_Int32 value);
friend OStream& operator<< (OStream& rStream, sal_Int16 value);
friend OStream& operator<< (OStream& rStream, sal_uInt8 value);
friend OStream& operator<< (OStream& rStream, sal_Char value);
};
inline sal_Bool OStream::read(sal_Int32& value) const
{
return (read(&value, sizeof(value)) == sizeof(value));
}
inline sal_Bool OStream::read(sal_Int16& value) const
{
return (read(&value, sizeof(value)) == sizeof(value));
}
inline sal_Bool OStream::read(sal_Char& value) const
{
return (read(&value, sizeof(value)) == sizeof(value));
}
inline sal_Bool OStream::read(sal_uInt8& value) const
{
return (read(&value, sizeof(value)) == sizeof(value));
}
inline sal_Bool OStream::write(sal_Int32 value)
{
return (write(&value, sizeof(value)) == sizeof(value));
}
inline sal_Bool OStream::write(sal_Int16 value)
{
return (write(&value, sizeof(value)) == sizeof(value));
}
inline sal_Bool OStream::write(sal_Char value)
{
return (write(&value, sizeof(value)) == sizeof(value));
}
inline sal_Bool OStream::write(sal_uInt8 value)
{
return (write((sal_uInt8*)&value, sizeof(value)) == sizeof(value));
}
inline sal_Bool OStream::seekToBegin() const
{
return (seekTo(0L));
}
inline const OStream& operator>> (OStream& rStream, sal_Int32& value)
{
rStream.read(value);
return (rStream);
}
inline const OStream& operator>> (OStream& rStream, sal_Int16& value)
{
rStream.read(value);
return (rStream);
}
inline const OStream& operator>> (OStream& rStream, sal_uInt8& value)
{
rStream.read(value);
return (rStream);
}
inline const OStream& operator>> (OStream& rStream, sal_Char& value)
{
rStream.read(value);
return (rStream);
}
inline OStream& operator<< (OStream& rStream, sal_Int32 value)
{
rStream.write(value);
return (rStream);
}
inline OStream& operator<< (OStream& rStream, sal_Int16 value)
{
rStream.write(value);
return (rStream);
}
inline OStream& operator<< (OStream& rStream, sal_uInt8 value)
{
rStream.write(value);
return (rStream);
}
inline OStream& operator<< (OStream& rStream, sal_Char value)
{
rStream.write(value);
return (rStream);
}
}
#endif // _VOS_STREAM_HXX_
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
*
* OpenOffice.org 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 Lesser General Public License version 3 for more details
* (a copy is included in the LICENSE file that accompanied this code).
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with OpenOffice.org. If not, see
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
*
************************************************************************/
#ifndef _VOS_THREAD_HXX_
#define _VOS_THREAD_HXX_
# include <vos/types.hxx>
# include <vos/object.hxx>
# include <osl/thread.h>
# include <osl/conditn.h>
# include <vos/runnable.hxx>
#include <osl/time.h>
namespace vos
{
extern "C" typedef void ThreadWorkerFunction_impl(void *);
ThreadWorkerFunction_impl threadWorkerFunction_impl;
/** OThread is an objectoriented interface for threads.
This class should be the base class for all objects using threads. The
main working function is the run() method and should be overriden in the
derived class. To support soft termination of a thread, yield() should
be called in regular intervalls and the return value should be checked.
If yield returned False the run method should return.
@author Bernd Hofner
@version 1.0
*/
class OThread : public NAMESPACE_VOS(IRunnable),
public NAMESPACE_VOS(OObject)
{
VOS_DECLARE_CLASSINFO(VOS_NAMESPACE(OThread, vos));
oslCondition m_aCondition;
public:
/** priority of thread.
*/
enum TThreadPriority
{
TPriority_Highest = osl_Thread_PriorityHighest,
TPriority_AboveNormal = osl_Thread_PriorityAboveNormal,
TPriority_Normal = osl_Thread_PriorityNormal,
TPriority_BelowNormal = osl_Thread_PriorityBelowNormal,
TPriority_Lowest = osl_Thread_PriorityLowest,
TPriority_Unknown = osl_Thread_PriorityUnknown
};
/**
*/
enum TThreadSleep
{
TSleep_Normal,
TSleep_Cancel,
TSleep_Pending,
TSleep_Active,
TSleep_Error,
TSleep_Unknown
};
typedef oslThreadIdentifier TThreadIdentifier;
/// Constructor
OThread();
/// Destructor kills thread if neccessary
virtual ~OThread();
/** Create running instance of a thread.
@returns True if thread could be created.
*/
sal_Bool SAL_CALL create();
/** Create suspended instance of a thread.
@returns True if thread could be created.
*/
sal_Bool SAL_CALL createSuspended();
/// Suspend a runnng thread
void SAL_CALL suspend();
/// Resume a suspended thread
void SAL_CALL resume();
/** Tries to kill the thread.
will not block and might not succeed when run() won't heed isTerminationRequested().
*/
virtual void SAL_CALL terminate();
/// Kill thread hard and block until it is actually gone
virtual void SAL_CALL kill();
/// Block till thread is terminated
void SAL_CALL join();
/// Check if thread is running.
sal_Bool SAL_CALL isRunning();
/** Change thread priority.
The valid priority levels are:
<ul>
<li>ThreadPriorityHighest,
<li>ThreadPriorityAboveNormal,
<li>ThreadPriorityNormal,
<li>ThreadPriorityBelowNormal,
<li>ThreadPriorityLowest,
</ul>
*/
void SAL_CALL setPriority(TThreadPriority Priority);
/** Query thread priority.
Valid return values are:
<ul>
<li>ThreadPriorityHighest,
<li>ThreadPriorityAboveNormal,
<li>ThreadPriorityNormal,
<li>ThreadPriorityBelowNormal,
<li>ThreadPriorityLowest,
<li>ThreadPriorityUnknown (returned if thread is killed)
</ul>
*/
TThreadPriority SAL_CALL getPriority();
TThreadIdentifier SAL_CALL getIdentifier() const;
static TThreadIdentifier SAL_CALL getCurrentIdentifier();
/** Let thread sleep a specified amout of time.
@param Delay specifies the number of time to sleep.
*/
TThreadSleep SAL_CALL sleep(const TimeValue& Delay);
/** Awake the sleeping thread.
@returns False if at least one of the handles is invalid
or the thread is not sleeping.
*/
sal_Bool SAL_CALL awake();
/** Let current thread wait a specified amout of time.
@param Delay specifies the number of time
to wait. Note, if you need to interrupt the waiting operation
use sleep instead.
*/
static void SAL_CALL wait(const TimeValue& Delay);
/** Reschedules threads.
Call within your loop if you
want other threads offer some processing time.
This method is static, so it might be used by the
main-thread.
*/
static void SAL_CALL yield();
protected:
/// Working method which should be overridden.
virtual void SAL_CALL run() = 0;
/** Checks if thread should terminate.
isTerminationRequested() will return True if someone called
terminate().
@return True if thread should terminate, False if he can continue.
*/
virtual sal_Bool SAL_CALL schedule();
/** Called when run() is done.
You might want to override it to do some cleanup.
*/
virtual void SAL_CALL onTerminated();
protected:
oslThread m_hThread;
sal_Bool m_bTerminating;
friend void threadWorkerFunction_impl(void *);
};
class OThreadData : public NAMESPACE_VOS(OObject)
{
VOS_DECLARE_CLASSINFO(VOS_NAMESPACE(OThreadData, vos));
public:
/// Create a thread specific local data key
OThreadData( oslThreadKeyCallbackFunction = 0 );
/// Destroy a thread specific local data key
virtual ~OThreadData();
/** Set the data associated with the data key.
@returns True if operation was successfull
*/
sal_Bool SAL_CALL setData(void *pData);
/** Get the data associated with the data key.
@returns The data asscoitaed with the data key or
NULL if no data was set
*/
void* SAL_CALL getData();
protected:
oslThreadKey m_hKey;
};
}
#endif // _VOS_THREAD_HXX_
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
*
* OpenOffice.org 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 Lesser General Public License version 3 for more details
* (a copy is included in the LICENSE file that accompanied this code).
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with OpenOffice.org. If not, see
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
*
************************************************************************/
#ifndef _VOS_TYPES_HXX_
#define _VOS_TYPES_HXX_
/* disable some warnings for MS-C */
#ifdef _MSC_VER
# pragma warning (disable : 4786) // 4786: truncated names (longer 255 chars)
# pragma warning (disable : 4355) // 4355: this used in initializer-list
#endif
#endif //_VOS_TYPES_HXX_
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
*
* OpenOffice.org 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 Lesser General Public License version 3 for more details
* (a copy is included in the LICENSE file that accompanied this code).
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with OpenOffice.org. If not, see
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
*
************************************************************************/
#ifndef _XCEPTION_HXX_
#define _XCEPTION_HXX_
#include <vos/object.hxx>
#ifdef _MSC_VER
#pragma warning( disable : 4290 )
#endif
namespace vos
{
/* avoid clashes with <vos/exception.hxx> */
#define OException OBaseException
/*
* Macros for true try/catch based Exception Handling (public)
* based on true rtti type checking
*/
#define THROW_AGAIN throw;
#define THROW( Constructor ) throw Constructor;
/*
* declaration of the exceptions that may be thrown by a function
* (e.g.) void myfunction(sal_Int32 a) throw ( std::bad_alloc );
* is not fully supported by all compilers
*/
#define THROWS( ARG ) throw ARG
/*
* just a base class for further exceptions
*/
class OException : public OObject
{
VOS_DECLARE_CLASSINFO(VOS_NAMESPACE(OException, vos));
public:
virtual ~OException();
OException() {}
OException( const OException & ) : OObject() {}
OException& SAL_CALL operator=(const OException&)
{ return *this; }
};
}
#endif /* _XCEPTION_HXX_ */
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
vo vos : sal solenv NULL
vo vos usr1 - all vo_mkout NULL
vo vos\inc\vos get - all vo_inc NULL
vo vos\prj get - all vo_prj NULL
vo vos\source nmake - all vo_sou NULL
vo vos\util nmake - all vo_util vo_sou NULL
mkdir: %_DEST%\inc%_EXT%\vos
..\version.mk %_DEST%\inc%_EXT%\vos\version.mk
..\inc\vos\*.h %_DEST%\inc%_EXT%\vos\*.h
..\inc\vos\*.hxx %_DEST%\inc%_EXT%\vos\*.hxx
..\inc\vos\*.inl %_DEST%\inc%_EXT%\vos\*.inl
..\%__SRC%\lib\avos.lib %_DEST%\lib%_EXT%\avos.lib
..\%__SRC%\lib\ivos.lib %_DEST%\lib%_EXT%\ivos.lib
..\%__SRC%\lib\*.sl %_DEST%\lib%_EXT%\*.sl
..\%__SRC%\lib\lib*.so %_DEST%\lib%_EXT%
..\%__SRC%\lib\lib*.a %_DEST%\lib%_EXT%
..\%__SRC%\lib\*.dylib %_DEST%\lib%_EXT%\*.dylib
..\%__SRC%\slb\cppvos.lib %_DEST%\lib%_EXT%\xvos.lib
..\%__SRC%\bin\vos*.dll %_DEST%\bin%_EXT%\vos*.dll
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
*
* OpenOffice.org 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 Lesser General Public License version 3 for more details
* (a copy is included in the LICENSE file that accompanied this code).
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with OpenOffice.org. If not, see
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
*
************************************************************************/
#include <windows.h>
#include <winsock.h>
#ifdef SHARED
sal_Int32 CALLBACK LibMain(HINSTANCE hinst, WORD wDataSeg, WORD cbHeap, LPSTR lpszCmdLine )
{
HGLOBAL hgblClassStruct;
LPWNDCLASS lpClassStruct;
static HINSTANCE hinstLib = NULL;
/* Has the library been initialized yet? */
if (hinstLib == NULL)
{
WORD wVersionRequested;
WSADATA wsaData;
sal_Int32 error;
wVersionRequested = 0x0101;
error = WSAStartup( wVersionRequested, &wsaData );
if (error)
{
}
else
hinstLib = hinst;
}
return (hinstLib ? TRUE : FALSE); /* return TRUE = success; FALSE = fail */
}
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
#*************************************************************************
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# Copyright 2000, 2010 Oracle and/or its affiliates.
#
# OpenOffice.org - a multi-platform office productivity suite
#
# This file is part of OpenOffice.org.
#
# OpenOffice.org is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License version 3
# only, as published by the Free Software Foundation.
#
# OpenOffice.org 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 Lesser General Public License version 3 for more details
# (a copy is included in the LICENSE file that accompanied this code).
#
# You should have received a copy of the GNU Lesser General Public License
# version 3 along with OpenOffice.org. If not, see
# <http://www.openoffice.org/license.html>
# for a copy of the LGPLv3 License.
#
#*************************************************************************
PRJ=..
PRJNAME=vos
TARGET=cppvos
ENABLE_EXCEPTIONS=TRUE
# --- Settings -----------------------------------------------------
.INCLUDE : settings.mk
# --- Files --------------------------------------------------------
SLOFILES= \
$(SLO)$/object.obj \
$(SLO)$/refernce.obj \
$(SLO)$/thread.obj \
$(SLO)$/stream.obj \
$(SLO)$/process.obj \
$(SLO)$/xception.obj
.IF "$(UPDATER)"=="YES"
OBJFILES= \
$(OBJ)$/object.obj \
$(OBJ)$/refernce.obj \
$(OBJ)$/thread.obj \
$(OBJ)$/stream.obj \
$(OBJ)$/process.obj \
$(OBJ)$/xception.obj
.ENDIF
# --- Targets ------------------------------------------------------
.INCLUDE : target.mk
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
*
* OpenOffice.org 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 Lesser General Public License version 3 for more details
* (a copy is included in the LICENSE file that accompanied this code).
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with OpenOffice.org. If not, see
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
*
************************************************************************/
#include <string.h>
#include <rtl/alloc.h>
#include <rtl/memory.h>
#include <osl/diagnose.h>
#include <vos/object.hxx>
using namespace vos;
/////////////////////////////////////////////////////////////////////////////
// Object super class
VOS_NAMESPACE(OClassInfo, vos) VOS_NAMESPACE(OObject, vos)::__ClassInfo__(VOS_CLASSNAME(OObject, vos), sizeof(VOS_NAMESPACE(OObject, vos)));
OObject::OObject()
{
}
OObject::OObject(const OCreateParam&)
{
}
OObject::~OObject()
{
}
void* OObject::operator new(size_t size)
{
void* p = rtl_allocateMemory(size);
OSL_ASSERT(p != NULL);
return (p);
}
void* OObject::operator new(size_t, void* p)
{
return (p);
}
void OObject::operator delete(void* p)
{
rtl_freeMemory(p);
}
const OClassInfo& OObject::classInfo()
{
return (__ClassInfo__);
}
const OClassInfo& OObject::getClassInfo() const
{
return (VOS_CLASSINFO(VOS_NAMESPACE(OObject, vos)));
}
sal_Bool OObject::isKindOf(const OClassInfo& rClass) const
{
OSL_ASSERT(this != NULL);
const OClassInfo& rClassThis = getClassInfo();
return (rClassThis.isDerivedFrom(rClass));
}
/////////////////////////////////////////////////////////////////////////////
// Basic class information
OClassInfo::OClassInfo(const sal_Char *pClassName, sal_Int32 ObjectSize,
const OClassInfo* pBaseClass, sal_uInt32 Schema,
OObject* (SAL_CALL * fnCreateObject)(const OCreateParam&))
{
m_pClassName = pClassName;
m_nObjectSize = ObjectSize;
m_wSchema = Schema;
m_pfnCreateObject = fnCreateObject;
m_pBaseClass = pBaseClass;
m_pNextClass = NULL;
}
OObject* OClassInfo::createObject(const OCreateParam& rParam) const
{
if (m_pfnCreateObject == NULL)
return NULL;
OObject* pObject = NULL;
pObject = (*m_pfnCreateObject)(rParam);
return (pObject);
}
sal_Bool OClassInfo::isDerivedFrom(const OClassInfo& rClass) const
{
OSL_ASSERT(this != NULL);
const OClassInfo* pClassThis = this;
while (pClassThis != NULL)
{
if (pClassThis == &rClass)
return (sal_True);
pClassThis = pClassThis->m_pBaseClass;
}
return (sal_False); // walked to the top, no match
}
const OClassInfo* OClassInfo::getClassInfo(const sal_Char* pClassName)
{
OSL_ASSERT(pClassName != NULL);
const OClassInfo* pClass = &VOS_CLASSINFO(VOS_NAMESPACE(OObject, vos));
while (pClass != NULL)
{
if (strcmp(pClassName, pClass->m_pClassName) == 0)
break;
pClass = pClass->m_pNextClass;
}
return (pClass);
}
VOS_CLASSINIT::VOS_CLASSINIT(register OClassInfo* pNewClass)
{
OSL_ASSERT(pNewClass != NULL);
OClassInfo* pClassRoot = (OClassInfo*)&VOS_CLASSINFO(VOS_NAMESPACE(OObject, vos));
pNewClass->m_pNextClass = pClassRoot->m_pNextClass;
pClassRoot->m_pNextClass = pNewClass;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
This diff is collapsed.
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
*
* OpenOffice.org 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 Lesser General Public License version 3 for more details
* (a copy is included in the LICENSE file that accompanied this code).
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with OpenOffice.org. If not, see
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
*
************************************************************************/
#include <limits.h>
#include <osl/diagnose.h>
#include <vos/refernce.hxx>
using namespace vos;
ORefCount::~ORefCount()
{
}
OReference::OReference()
{
}
OReference::~OReference()
{
OSL_ASSERT(m_RefCount.referenced() == 0);
}
IReference::RefCount OReference::acquire()
{
return (m_RefCount.acquire());
}
IReference::RefCount OReference::release()
{
RefCount Count = m_RefCount.release();
if (Count == 0)
delete this;
return (Count);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
*
* OpenOffice.org 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 Lesser General Public License version 3 for more details
* (a copy is included in the LICENSE file that accompanied this code).
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with OpenOffice.org. If not, see
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
*
************************************************************************/
#include <limits>
#include <osl/diagnose.h>
#include <vos/object.hxx>
#include <vos/stream.hxx>
using namespace vos;
/////////////////////////////////////////////////////////////////////////////
//
// Stream class
//
VOS_IMPLEMENT_CLASSINFO(VOS_CLASSNAME(OStream, vos), VOS_NAMESPACE(OStream, vos), VOS_NAMESPACE(OObject, vos), 0);
OStream::OStream(IPositionableStream& rStream)
: m_rStream(rStream)
{
}
OStream::~OStream()
{
}
sal_Int32 OStream::read(void* pbuffer, sal_uInt32 n) const
{
return (m_rStream.read(pbuffer, n));
}
sal_Int32 OStream::read(IPositionableStream::Offset offset,
void* pbuffer, sal_uInt32 n) const
{
return (seekTo(offset) ? read(pbuffer, n) : -1);
}
sal_Int32 OStream::write(const void* pbuffer, sal_uInt32 n)
{
return
n <= static_cast< sal_uInt32 >(std::numeric_limits< sal_Int32 >::max())
&& (m_rStream.write(pbuffer, n) == static_cast< sal_Int32 >(n));
}
sal_Int32 OStream::write(IPositionableStream::Offset offset,
const void* pbuffer, sal_uInt32 n)
{
return (seekTo(offset) && write(pbuffer, n));
}
sal_Bool OStream::append(void* pbuffer, sal_uInt32 n)
{
return (seekToEnd() && write(pbuffer, n));
}
sal_Bool OStream::seekTo(IPositionableStream::Offset pos) const
{
return (m_rStream.seekTo(pos));
}
sal_Bool OStream::seekToEnd() const
{
return (m_rStream.seekToEnd());
}
sal_Bool OStream::seekRelative(sal_Int32 change) const
{
return (m_rStream.seekRelative(change));
}
sal_Bool OStream::changeSize(sal_uInt32 new_size)
{
return (m_rStream.changeSize(new_size));
}
sal_uInt32 OStream::getSize() const
{
return (m_rStream.getSize());
}
sal_Bool OStream::isEof() const
{
return (m_rStream.isEof());
}
IPositionableStream::Offset OStream::getOffset() const
{
return (m_rStream.getOffset());
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
*
* OpenOffice.org 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 Lesser General Public License version 3 for more details
* (a copy is included in the LICENSE file that accompanied this code).
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with OpenOffice.org. If not, see
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
*
************************************************************************/
#include <osl/time.h>
#include <vos/object.hxx>
#include <vos/thread.hxx>
#include <osl/diagnose.h>
using namespace vos;
void vos::threadWorkerFunction_impl(void * pthis)
{
NAMESPACE_VOS(OThread)* pThis= (NAMESPACE_VOS(OThread)*)pthis;
// call Handler-Function of OThread-derived class
pThis->run();
// if not already terminating, by a kill do normal shutdown
if (! pThis->m_bTerminating)
{
pThis->m_bTerminating = sal_True;
pThis->onTerminated(); // could e.g. delete this
}
}
/////////////////////////////////////////////////////////////////////////////
//
// Thread class
//
VOS_IMPLEMENT_CLASSINFO(VOS_CLASSNAME(OThread, vos),
VOS_NAMESPACE(OThread, vos),
VOS_NAMESPACE(OObject, vos), 0);
OThread::OThread()
{
m_hThread = 0;
m_bTerminating = sal_False;
m_aCondition = osl_createCondition();
}
OThread::~OThread()
{
if (m_hThread != 0)
{
osl_destroyThread(m_hThread);
}
osl_destroyCondition( m_aCondition );
}
sal_Bool OThread::create()
{
OSL_ASSERT(m_hThread == 0); // only one running thread per instance
m_hThread = osl_createSuspendedThread(
threadWorkerFunction_impl, (void*)this);
if (m_hThread)
osl_resumeThread(m_hThread);
return m_hThread != 0;
}
sal_Bool OThread::createSuspended()
{
OSL_ASSERT(m_hThread == 0); // only one running thread per instance
m_hThread= osl_createSuspendedThread(threadWorkerFunction_impl, (void*)this);
return m_hThread != 0;
}
void OThread::suspend()
{
OSL_ASSERT(m_hThread != 0); // use only on running thread
osl_suspendThread(m_hThread);
}
void OThread::resume()
{
OSL_ASSERT(m_hThread != 0); // use only on running thread
osl_resumeThread(m_hThread);
}
sal_Bool OThread::isRunning()
{
return m_hThread != 0 && osl_isThreadRunning(m_hThread);
}
OThread::TThreadIdentifier OThread::getIdentifier() const
{
return (TThreadIdentifier)osl_getThreadIdentifier(m_hThread);
}
OThread::TThreadIdentifier OThread::getCurrentIdentifier()
{
return (TThreadIdentifier)osl_getThreadIdentifier(0);
}
void OThread::join()
{
if (m_hThread) {
OSL_ASSERT(getCurrentIdentifier() != getIdentifier());
osl_joinWithThread(m_hThread);
}
}
OThread::TThreadSleep OThread::sleep(const TimeValue& Delay)
{
TThreadSleep eRet;
switch( osl_waitCondition( m_aCondition, &Delay ) )
{
case osl_cond_result_ok:
eRet = TSleep_Normal;
break;
case osl_cond_result_timeout:
eRet = TSleep_Cancel;
break;
default:
eRet = TSleep_Error;
break;
}
return eRet;
}
void OThread::wait(const TimeValue& Delay) {
osl_waitThread(&Delay);
}
sal_Bool OThread::awake()
{
osl_setCondition( m_aCondition );
return osl_resetCondition( m_aCondition );
}
void OThread::terminate()
{
osl_terminateThread(m_hThread);
}
sal_Bool OThread::schedule() {
return osl_scheduleThread(m_hThread);
}
void OThread::kill()
{
if (osl_isThreadRunning(m_hThread))
{
// flag we are shutting down
m_bTerminating = sal_True;
terminate();
join();
}
}
void OThread::setPriority(OThread::TThreadPriority Priority)
{
osl_setThreadPriority(m_hThread, (oslThreadPriority)Priority);
}
OThread::TThreadPriority OThread::getPriority()
{
return (TThreadPriority)osl_getThreadPriority(m_hThread);
}
void OThread::yield()
{
osl_yieldThread();
}
void OThread::onTerminated()
{
}
/////////////////////////////////////////////////////////////////////////////
//
// ThreadData class
//
VOS_IMPLEMENT_CLASSINFO(VOS_CLASSNAME(OThreadData, vos),
VOS_NAMESPACE(OThreadData, vos),
VOS_NAMESPACE(OObject, vos), 0);
OThreadData::OThreadData( oslThreadKeyCallbackFunction pCallback )
{
m_hKey = osl_createThreadKey( pCallback );
OSL_VERIFY(m_hKey);
}
OThreadData::~OThreadData()
{
osl_destroyThreadKey(m_hKey);
}
sal_Bool OThreadData::setData(void *pData)
{
OSL_ASSERT(m_hKey != 0);
return (osl_setThreadKeyData(m_hKey, pData));
}
void *OThreadData::getData()
{
OSL_ASSERT(m_hKey != 0);
return (osl_getThreadKeyData(m_hKey));
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
*
* OpenOffice.org 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 Lesser General Public License version 3 for more details
* (a copy is included in the LICENSE file that accompanied this code).
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with OpenOffice.org. If not, see
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
*
************************************************************************/
#include <vos/xception.hxx>
using namespace vos;
/*
* OException, baseclass of all exceptions
*/
VOS_IMPLEMENT_CLASSINFO(VOS_CLASSNAME(OException, vos), \
VOS_NAMESPACE(OException, vos), \
VOS_NAMESPACE(OObject, vos), 0);
OException::~OException()
{
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
This diff is collapsed.
#*************************************************************************
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# Copyright 2000, 2010 Oracle and/or its affiliates.
#
# OpenOffice.org - a multi-platform office productivity suite
#
# This file is part of OpenOffice.org.
#
# OpenOffice.org is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License version 3
# only, as published by the Free Software Foundation.
#
# OpenOffice.org 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 Lesser General Public License version 3 for more details
# (a copy is included in the LICENSE file that accompanied this code).
#
# You should have received a copy of the GNU Lesser General Public License
# version 3 along with OpenOffice.org. If not, see
# <http://www.openoffice.org/license.html>
# for a copy of the LGPLv3 License.
#
#*************************************************************************
RTLLIB=irtl.lib
PRJ=..
PRJNAME=vos
TARGET=vos
TARGETTYPE=CUI
# --- Settings -----------------------------------------------------
.INCLUDE : settings.mk
.INCLUDE : ..$/version.mk
# --- Files --------------------------------------------------------
SHL1TARGET=$(VOS_TARGET)$(VOS_MAJOR)$(COMID)
SHL1IMPLIB=i$(TARGET)
.IF "$(GUI)"=="WNT"
SHL1STDLIBS=$(WSOCK32LIB) $(SALLIB)
.ELSE
SHL1STDLIBS=$(SALLIB)
.ENDIF
SHL1LIBS= $(SLB)$/cpp$(TARGET).lib
.IF "$(GUI)" != "UNX"
.IF "$(COM)" != "GCC"
SHL1OBJS= \
$(SLO)$/object.obj
.ENDIF
.ENDIF
SHL1DEPN=
SHL1DEF= $(MISC)$/$(SHL1TARGET).def
DEF1NAME =$(SHL1TARGET)
DEF1DEPN =$(MISC)$/$(SHL1TARGET).flt
DEFLIB1NAME =cppvos
# --- Targets ------------------------------------------------------
.INCLUDE : target.mk
$(MISC)$/$(SHL1TARGET).flt:
@echo ------------------------------
@echo Making: $@
@echo WEP > $@
@echo LIBMAIN >> $@
@echo LibMain >> $@
@echo _alloc >> $@
@echo alloc >> $@
@echo _CT >> $@
@echo _TI2 >> $@
@echo _TI1 >> $@
@echo exception::exception >> $@
@echo @std@ >> $@
@echo __>>$@
#*************************************************************************
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# Copyright 2000, 2010 Oracle and/or its affiliates.
#
# OpenOffice.org - a multi-platform office productivity suite
#
# This file is part of OpenOffice.org.
#
# OpenOffice.org is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License version 3
# only, as published by the Free Software Foundation.
#
# OpenOffice.org 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 Lesser General Public License version 3 for more details
# (a copy is included in the LICENSE file that accompanied this code).
#
# You should have received a copy of the GNU Lesser General Public License
# version 3 along with OpenOffice.org. If not, see
# <http://www.openoffice.org/license.html>
# for a copy of the LGPLv3 License.
#
#*************************************************************************
# target
VOS_TARGET=vos
# the major
VOS_MAJOR=3
# the minor
VOS_MINOR=0
# the micro
VOS_MICRO=0
# this is a c++ compatible library
VOS_CPP=1
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment