/[usata]/usata2/src/xml/scene_parser.cpp
ViewVC logotype

Diff of /usata2/src/xml/scene_parser.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by skunix, Wed Feb 16 06:30:02 2005 UTC revision 1.2 by skunix, Fri Feb 18 02:24:33 2005 UTC
# Line 12  Line 12 
12  //  //
13  // $Id$  // $Id$
14    
15    #include <map>
16    #include <iostream>
17    
18  #include <boost/thread.hpp>  #include <boost/thread.hpp>
19  #include <boost/bind.hpp>  #include <boost/bind.hpp>
20  #include <boost/scoped_array.hpp>  #include <boost/scoped_array.hpp>
21  #include "scene_parser.hpp"  
 #include <iostream>  
22  #include <expat.h>  #include <expat.h>
23    
24    #include "scene_parser.hpp"
25    #include "scene_parser_elements.hpp"
26    #include "../log.hpp"
27    
28  namespace usata  namespace usata
29  {  {
30    
31    
32  class SceneDocument  SceneElement::SceneElement(SceneElement*parent,
33  :       public SceneElement                                                          SceneParser*parser)
34  {  {
35                  SceneDocument(SceneParser *parser);          mParent = parent;
36  };          mParser = parser;
37            return;
38    }
39    
40    
41  SceneParser::SceneParser(std::istream& stream,  SceneParser::SceneParser(std::istream& stream,
# Line 56  SceneParser::~SceneParser() Line 65  SceneParser::~SceneParser()
65  void  void
66  SceneParser::element_start(const char* name, const char**attrib)  SceneParser::element_start(const char* name, const char**attrib)
67  {  {
68            if (mElements.empty())
69            {
70                    SceneElement * ns = new SceneDocument(this);
71                    ns->start_element(name,attrib);
72                    mElements.push_back(ns);
73                    return;
74            }
75                    
   
   
76  }  }
77  void SceneParser::element_end(const char*)  void SceneParser::element_end(const char*)
78  {  {
# Line 75  SceneParser::thread_main() Line 89  SceneParser::thread_main()
89          std::streamsize readlen;          std::streamsize readlen;
90          std::streamsize x=0;          std::streamsize x=0;
91          bool done(false);                bool done(false);      
   
92                    
93          void*buf;          void*buf;
94          while (!done)          while (!done)
# Line 100  void Line 113  void
113  SceneParser::threaded_parse()  SceneParser::threaded_parse()
114  {  {
115          mThread.reset(new boost::thread(boost::bind(&SceneParser::thread_main,this)));          mThread.reset(new boost::thread(boost::bind(&SceneParser::thread_main,this)));
   
   
116  }  }
117    
118  }  }

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26