13 |
// $Id$ |
// $Id$ |
14 |
|
|
15 |
#include <map> |
#include <map> |
|
#include <iostream> |
|
16 |
|
|
17 |
#include <boost/thread.hpp> |
#include <boost/thread.hpp> |
18 |
#include <boost/bind.hpp> |
#include <boost/bind.hpp> |
42 |
: mIs(stream), |
: mIs(stream), |
43 |
mStreamName(stream_name) |
mStreamName(stream_name) |
44 |
{ |
{ |
45 |
|
mOk=true; |
46 |
} |
} |
47 |
|
|
48 |
void |
void |
56 |
{ |
{ |
57 |
boost::mutex::scoped_lock p(mObjectQueue_M); |
boost::mutex::scoped_lock p(mObjectQueue_M); |
58 |
mObjectQueue.push(aNewOD); |
mObjectQueue.push(aNewOD); |
59 |
std::cout << "ready with object of type " << aNewOD->type << std::endl;; |
// std::cout << "ready with object of type " << aNewOD->type << std::endl;; |
60 |
return; |
return; |
61 |
} |
} |
62 |
|
|
104 |
using namespace scene_parser_elements; |
using namespace scene_parser_elements; |
105 |
//create an ignore element |
//create an ignore element |
106 |
ne = new IgnoreE(te, this); |
ne = new IgnoreE(te, this); |
107 |
std::cout << "ignore '"<<name<<"'" << std::endl; |
//std::cout << "ignore '"<<name<<"'" << std::endl; |
108 |
} |
} |
109 |
|
|
110 |
mElements.push(ne); |
mElements.push(ne); |
149 |
|
|
150 |
if (!parse_chunkb(readlen, done)) |
if (!parse_chunkb(readlen, done)) |
151 |
{ |
{ |
152 |
std::cout << get_error() << std::endl; |
log::BufferedStream ls(log::Level::ERROR); |
153 |
return; |
ls << get_error() << log::commit; |
154 |
|
mOk=false; |
155 |
|
|
156 |
|
break; |
157 |
} |
} |
158 |
|
|
159 |
if (mThreadAbort) |
if (mThreadAbort) |
160 |
return; |
return; |
161 |
} |
} |
162 |
|
mFinished=true; |
163 |
return; |
return; |
164 |
} |
} |
165 |
|
|
173 |
SceneParser::threaded_parse() |
SceneParser::threaded_parse() |
174 |
{ |
{ |
175 |
mThreadAbort=false; |
mThreadAbort=false; |
176 |
|
mFinished=false; |
177 |
mThread.reset( |
mThread.reset( |
178 |
new boost::thread( |
new boost::thread( |
179 |
boost::bind(&SceneParser::thread_main,this) |
boost::bind(&SceneParser::thread_main,this) |