[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Usata-commits] Changes to usata2/src/xml/scene_parser.hpp
From: |
David Lau |
Subject: |
[Usata-commits] Changes to usata2/src/xml/scene_parser.hpp |
Date: |
Tue, 22 Feb 2005 13:18:02 -0500 |
Index: usata2/src/xml/scene_parser.hpp
diff -u usata2/src/xml/scene_parser.hpp:1.2 usata2/src/xml/scene_parser.hpp:1.3
--- usata2/src/xml/scene_parser.hpp:1.2 Fri Feb 18 02:24:33 2005
+++ usata2/src/xml/scene_parser.hpp Tue Feb 22 18:17:57 2005
@@ -10,12 +10,14 @@
// included in the software distribution, or visit
// http://www.fsf.org/licenses/gpl.html.
//
-// $Id: scene_parser.hpp,v 1.2 2005/02/18 02:24:33 skunix Exp $
+// $Id: scene_parser.hpp,v 1.3 2005/02/22 18:17:57 skunix Exp $
#ifndef USATA_SCENE_PARSER_HPP
#define USATA_SCENE_PARSER_HPP
-#include <deque>
+#include <stack>
+#include <queue>
+
#include <string>
#include <memory>
#include <istream>
@@ -26,13 +28,11 @@
#include "parser.hpp"
#include "../gproperties.hpp"
-namespace boost{class thread;}
+namespace boost {class thread;}
namespace usata
{
struct ObjectDescription
{
- std::string name;
- std::string path;
std::string type;
GProperties<std::string> props;
};
@@ -56,23 +56,36 @@
};
typedef boost::shared_ptr<SceneElement> SceneElement_sp;
-class SceneParser : public XML::Parser
+class SceneParser
+: public XML::Parser
{
private:
- std::deque<SceneElement*> mElements;
+ typedef std::queue<ObjectDescription*> ODQueue;
+
+ std::stack<SceneElement*> mElements;
+ ODQueue mObjectQueue;
std::auto_ptr<boost::thread> mThread;
+
std::istream& mIs;
std::string mStreamName;
+
size_t mChunkSize;
size_t mElementBufferSize;
boost::mutex mElements_M;
+ boost::mutex mObjectQueue_M;
+ bool mThreadAbort;
+
void init();
void thread_main();
public:
+ void add_object(ObjectDescription*);
+ ObjectDescription* get_object();
+
SceneParser(std::istream& is, const std::string& = "<unnamed>");
+ const std::string &get_stream_name()const{return mStreamName;}
virtual ~SceneParser();
void threaded_parse();
void threaded_abort();