Update of /cvsroot/xplc/xplc/xplc
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1060/xplc
Modified Files:
rules.mk servmgr.cpp vars.mk
Added Files:
uuidgen.cpp uuidgen.h
Log Message:
Added a component to programmatically generate UUIDs.
--- NEW FILE: uuidgen.cpp ---
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* XPLC - Cross-Platform Lightweight Components
* Copyright (C) 2005, Net Integration Technologies, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This library 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 for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*/
#include "uuidgen.h"
/*
* We need to do this last, because we define uuid_t in an
* incompatible way.
*/
#undef uuid_t
#include <uuid/uuid.h>
UUID_MAP_BEGIN(UuidGen)
UUID_MAP_ENTRY(IObject)
UUID_MAP_ENTRY(IUuidGen)
UUID_MAP_END
struct EvilUUID {
uuid_t uuid;
};
UUID UuidGen::createUuid() {
UUID rv;
uuid_generate(reinterpret_cast<EvilUUID*>(&rv)->uuid);
return rv;
}
--- NEW FILE: uuidgen.h ---
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* XPLC - Cross-Platform Lightweight Components
* Copyright (C) 2005, Net Integration Technologies, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This library 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 for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*/
#ifndef __XPLC_UUIDGEN_H__
#define __XPLC_UUIDGEN_H__
#include <xplc/IUuidGen.h>
#include <xplc/utils.h>
class UuidGen: public IUuidGen {
IMPLEMENT_IOBJECT(UuidGen);
public:
virtual UUID createUuid();
};
#endif /* __XPLC_UUIDGEN_H__ */
Index: vars.mk
===================================================================
RCS file: /cvsroot/xplc/xplc/xplc/vars.mk,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** vars.mk 5 Dec 2002 03:48:19 -0000 1.13
--- vars.mk 20 Dec 2005 02:28:49 -0000 1.14
***************
*** 1,5 ****
# XPLC - Cross-Platform Lightweight Components
# Copyright (C) 2000-2002, Pierre Phaneuf
! # Copyright (C) 2002, Net Integration Technologies, Inc.
#
# This library is free software; you can redistribute it and/or modify
--- 1,5 ----
# XPLC - Cross-Platform Lightweight Components
# Copyright (C) 2000-2002, Pierre Phaneuf
! # Copyright (C) 2002-2005, Net Integration Technologies, Inc.
#
# This library is free software; you can redistribute it and/or modify
***************
*** 37,38 ****
--- 37,46 ----
endif
+ ifneq ("$(with_uuid)", "no")
+ libxplc.so: LDFLAGS+=$(with_uuid)
+ endif
+
+ ifneq ("$(with_uuid)", "no")
+ CPPFLAGS+=-I.
+ endif
+
Index: servmgr.cpp
===================================================================
RCS file: /cvsroot/xplc/xplc/xplc/servmgr.cpp,v
retrieving revision 1.34
retrieving revision 1.35
diff -C2 -d -r1.34 -r1.35
*** servmgr.cpp 20 Jul 2004 14:35:44 -0000 1.34
--- servmgr.cpp 20 Dec 2005 02:28:49 -0000 1.35
***************
*** 4,8 ****
* Copyright (C) 2000-2004, Pierre Phaneuf
* Copyright (C) 2000, Stéphane Lajoie
! * Copyright (C) 2002-2004, Net Integration Technologies, Inc.
*
* This library is free software; you can redistribute it and/or
--- 4,8 ----
* Copyright (C) 2000-2004, Pierre Phaneuf
* Copyright (C) 2000, Stéphane Lajoie
! * Copyright (C) 2002-2005, Net Integration Technologies, Inc.
*
* This library is free software; you can redistribute it and/or
***************
*** 32,35 ****
--- 32,36 ----
#include "new.h"
#include "modulemgr.h"
+ #include "uuidgen.h"
UUID_MAP_BEGIN(ServiceManager)
***************
*** 86,89 ****
--- 87,96 ----
}
+ obj = new UuidGen;
+ if(obj) {
+ handler->addObject(XPLC_uuidGen, obj);
+ obj->release();
+ }
+
obj = new ModuleLoader;
if(obj) {
Index: rules.mk
===================================================================
RCS file: /cvsroot/xplc/xplc/xplc/rules.mk,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -d -r1.19 -r1.20
*** rules.mk 21 May 2004 20:21:35 -0000 1.19
--- rules.mk 20 Dec 2005 02:28:49 -0000 1.20
***************
*** 1,5 ****
# XPLC - Cross-Platform Lightweight Components
# Copyright (C) 2000-2002, Pierre Phaneuf
! # Copyright (C) 2002-2004, Net Integration Technologies, Inc.
#
# This library is free software; you can redistribute it and/or modify
--- 1,5 ----
# XPLC - Cross-Platform Lightweight Components
# Copyright (C) 2000-2002, Pierre Phaneuf
! # Copyright (C) 2002-2005, Net Integration Technologies, Inc.
#
# This library is free software; you can redistribute it and/or modify
***************
*** 26,29 ****
--- 26,33 ----
libxplc.so: libxplc-cxx.a
+ ifneq ("$(with_uuid_static)", "no")
+ libxplc.so: $(with_uuid_static)
+ endif
+
xplc-uninstalled.pc: dist/xplc-uninstalled.pc
cp $^ $@
|