Revision: 8379
http://playerstage.svn.sourceforge.net/playerstage/?rev=8379&view=rev
Author: rtv
Date: 2009-11-08 20:32:58 +0000 (Sun, 08 Nov 2009)
Log Message:
-----------
re-added basic property set/get for world and models. Removed unused mutexes
Modified Paths:
--------------
code/stage/trunk/CMakeLists.txt
code/stage/trunk/RELEASE.txt
code/stage/trunk/docsrc/stage.dox
code/stage/trunk/libstage/ancestor.cc
code/stage/trunk/libstage/model.cc
code/stage/trunk/libstage/stage.hh
Modified: code/stage/trunk/CMakeLists.txt
===================================================================
--- code/stage/trunk/CMakeLists.txt 2009-11-06 19:32:26 UTC (rev 8378)
+++ code/stage/trunk/CMakeLists.txt 2009-11-08 20:32:58 UTC (rev 8379)
@@ -2,7 +2,7 @@
SET( V_MAJOR 3 )
SET( V_MINOR 2 )
-SET( V_BUGFIX 1 )
+SET( V_BUGFIX 2 )
SET( VERSION ${V_MAJOR}.${V_MINOR}.${V_BUGFIX} )
SET( APIVERSION ${V_MAJOR}.${V_MINOR} )
Modified: code/stage/trunk/RELEASE.txt
===================================================================
--- code/stage/trunk/RELEASE.txt 2009-11-06 19:32:26 UTC (rev 8378)
+++ code/stage/trunk/RELEASE.txt 2009-11-08 20:32:58 UTC (rev 8379)
@@ -1,3 +1,20 @@
+Version 3.2.2
+-------------
+
+Bugfix, performance and cleanup release. This is the fastest Stage
+ever for most use cases.
+
+Externally visible changes
+
+ - removed property database from models. This will break user code
+ that depends on it. The rationale for removing it is that it is not
+ useful to libstage users, and only to libstageplugin users who used
+ it for Player-based IPC. It should be provided by a Player
+ driver. Removing this little-used code is a useful clean up.
+
+Richard Vaughan (rtv) [email protected] - 2009.10.28
+
+
Version 3.2.1
-------------
Modified: code/stage/trunk/docsrc/stage.dox
===================================================================
--- code/stage/trunk/docsrc/stage.dox 2009-11-06 19:32:26 UTC (rev 8378)
+++ code/stage/trunk/docsrc/stage.dox 2009-11-08 20:32:58 UTC (rev 8379)
@@ -23,7 +23,7 @@
# This could be handy for archiving the generated documentation or
# if some version control system is used.
-PROJECT_NUMBER = 3.2.1
+PROJECT_NUMBER = 3.2.2
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
# base path where the generated documentation will be put.
Modified: code/stage/trunk/libstage/ancestor.cc
===================================================================
--- code/stage/trunk/libstage/ancestor.cc 2009-11-06 19:32:26 UTC (rev
8378)
+++ code/stage/trunk/libstage/ancestor.cc 2009-11-08 20:32:58 UTC (rev
8379)
@@ -5,13 +5,14 @@
Ancestor::Ancestor() :
+ //access_mutex(),
+ child_type_counts(),
children(),
debug( false ),
- token(),
- access_mutex(),
- child_type_counts()
+ props(),
+ token()
{
- pthread_mutex_init( &access_mutex, NULL );
+ //pthread_mutex_init( &access_mutex, NULL );
}
Ancestor::~Ancestor()
Modified: code/stage/trunk/libstage/model.cc
===================================================================
--- code/stage/trunk/libstage/model.cc 2009-11-06 19:32:26 UTC (rev 8378)
+++ code/stage/trunk/libstage/model.cc 2009-11-08 20:32:58 UTC (rev 8379)
@@ -252,7 +252,7 @@
Model* parent,
const std::string& type ) :
Ancestor(),
- access_mutex(),
+ //access_mutex(),
alwayson(false),
blockgroup(),
blocks_dl(0),
@@ -277,7 +277,6 @@
pose(),
power_pack( NULL ),
pps_charging(),
- props(),
rastervis(),
rebuild_displaylist(true),
say_string(),
Modified: code/stage/trunk/libstage/stage.hh
===================================================================
--- code/stage/trunk/libstage/stage.hh 2009-11-06 19:32:26 UTC (rev 8378)
+++ code/stage/trunk/libstage/stage.hh 2009-11-08 20:32:58 UTC (rev 8379)
@@ -1,3 +1,4 @@
+
#ifndef STG_H
#define STG_H
/*
@@ -639,42 +640,49 @@
friend class Canvas; // allow Canvas access to our private members
protected:
+
+ /** array contains the number of each type of child model */
+ std::map<std::string,unsigned int> child_type_counts;
+
ModelPtrVec children;
+
bool debug;
+
+ /** A key-value database for users to associate arbitrary things with
this object. */
+ std::map<std::string,void*> props;
+
std::string token;
- pthread_mutex_t access_mutex; ///< Used by Lock() and Unlock() to
prevent parallel access to this model
void Load( Worldfile* wf, int section );
- void Save( Worldfile* wf, int section );
+ void Save( Worldfile* wf, int section );
+
+ public:
+ Ancestor();
+ virtual ~Ancestor();
- public:
- /* The maximum length of a Stage model identifier string */
- //static const uint32_t TOKEN_MAX = 64;
-
/** get the children of the this element */
ModelPtrVec& GetChildren(){ return children;}
/** recursively call func( model, arg ) for each descendant */
void ForEachDescendant( stg_model_callback_t func, void* arg );
-
- /** array contains the number of each type of child model */
- std::map<std::string,unsigned int> child_type_counts;
- Ancestor();
- virtual ~Ancestor();
-
virtual void AddChild( Model* mod );
virtual void RemoveChild( Model* mod );
virtual Pose GetGlobalPose();
- const char* Token()
- { return token.c_str(); }
+ const char* Token(){ return token.c_str(); }
- void SetToken( const std::string& str )
- { token = str; }
-
- void Lock(){ pthread_mutex_lock( &access_mutex ); }
- void Unlock(){ pthread_mutex_unlock( &access_mutex ); }
+ void SetToken( const std::string& str ){ token = str; }
+
+ /** A key-value database for users to associate arbitrary things with
this model. */
+ void SetProperty( std::string& key, void* value ){ props[ key ] =
value; }
+
+ /** A key-value database for users to associate arbitrary things with
this model. */
+ void* GetProperty( std::string& key )
+ {
+ std::map<std::string,void*>::iterator it = props.find( key );
+ return( it == props.end() ? NULL : it->second );
+ }
};
/** raytrace sample
@@ -1597,7 +1605,6 @@
const std::vector<Option*>& getOptions() const { return drawOptions; }
protected:
- pthread_mutex_t access_mutex;
/** If true, the model always has at least one subscription, so
always runs. Defaults to false. */
@@ -1743,11 +1750,6 @@
initially NULL. */
std::list<PowerPack*> pps_charging;
- /** Props map can contain arbitrary named data items. Can be
used
- by derived model types to store properties, and
for user code
- to associate arbitrary items with a model. */
- std::map<std::string,const void*> props;
-
/** Visualize the most recent rasterization operation performed by
this model */
class RasterVis : public Visualizer
{
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Playerstage-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-commit