Revision: 8961
http://playerstage.svn.sourceforge.net/playerstage/?rev=8961&view=rev
Author: natepak
Date: 2010-11-12 02:10:14 +0000 (Fri, 12 Nov 2010)
Log Message:
-----------
Updates to libgazebo
Modified Paths:
--------------
code/gazebo/branches/dev/libgazebo/Iface.cc
code/gazebo/branches/dev/libgazebo/Server.cc
code/gazebo/branches/dev/libgazebo/gz.h
Modified: code/gazebo/branches/dev/libgazebo/Iface.cc
===================================================================
--- code/gazebo/branches/dev/libgazebo/Iface.cc 2010-11-12 02:06:48 UTC (rev
8960)
+++ code/gazebo/branches/dev/libgazebo/Iface.cc 2010-11-12 02:10:14 UTC (rev
8961)
@@ -120,7 +120,7 @@
//////////////////////////////////////////////////////////////////////////////
// Create an interface (server)
-void Iface::Create(Server *server, std::string id)
+void Iface::Create(Server *server, std::string id )
{
std::ostringstream stream;
Modified: code/gazebo/branches/dev/libgazebo/Server.cc
===================================================================
--- code/gazebo/branches/dev/libgazebo/Server.cc 2010-11-12 02:06:48 UTC
(rev 8960)
+++ code/gazebo/branches/dev/libgazebo/Server.cc 2010-11-12 02:10:14 UTC
(rev 8961)
@@ -44,6 +44,8 @@
using namespace libgazebo;
+int Server::serverIdCounter = 0;
+
union semun
{
int val;
@@ -66,14 +68,15 @@
////////////////////////////////////////////////////////////////////////////////
// Initialize the server
-void Server::Init(int serverId, int force)
+void Server::Init(const std::string &serverName, int force)
{
char *tmpdir;
char *user;
std::ostringstream stream;
std::ostringstream errStream;
- this->serverId = serverId;
+ this->serverId = serverIdCounter++;
+ this->serverName = serverName;
// Initialize semaphores. Do this first to make sure we dont have
// another server running with the same id.
@@ -89,7 +92,7 @@
if (!user)
user = (char*)"nobody";
- stream << tmpdir << "/gazebo-" << user << "-" << this->serverId;
+ stream << tmpdir << "/gazebo-" << user << "-" << this->serverName;
this->filename = stream.str();
// check to see if there is already a directory created.
@@ -175,8 +178,6 @@
{
char cmd[1024];
- //std::cout << "deleting " << this->filename << "\n";
-
// unlink the pid file
std::string pidfn = this->filename + "/gazebo.pid";
if (unlink(pidfn.c_str()) < 0)
Modified: code/gazebo/branches/dev/libgazebo/gz.h
===================================================================
--- code/gazebo/branches/dev/libgazebo/gz.h 2010-11-12 02:06:48 UTC (rev
8960)
+++ code/gazebo/branches/dev/libgazebo/gz.h 2010-11-12 02:10:14 UTC (rev
8961)
@@ -173,7 +173,7 @@
public: virtual ~Server();
/// \brief Initialize the server
- public: void Init(int serverId, int force);
+ public: void Init(const std::string &serverName, int force);
/// \brief Finalize the server
public: void Fini();
@@ -185,8 +185,11 @@
private: void SemFini();
private: void SemPost();
+ public: std::string serverName;
+
/// The server id
- public: int serverId;
+ private: int serverId;
+ private: static int serverIdCounter;
/// The directory containing mmap files
public: std::string filename;
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Centralized Desktop Delivery: Dell and VMware Reference Architecture
Simplifying enterprise desktop deployment and management using
Dell EqualLogic storage and VMware View: A highly scalable, end-to-end
client virtualization framework. Read more!
http://p.sf.net/sfu/dell-eql-dev2dev
_______________________________________________
Playerstage-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-commit