[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] /srv/bzr/gnash/rtmp r9602: Rename Que to que_t.
From: |
rob |
Subject: |
[Gnash-commit] /srv/bzr/gnash/rtmp r9602: Rename Que to que_t. |
Date: |
Wed, 27 Aug 2008 19:20:30 -0600 |
User-agent: |
Bazaar (1.5) |
------------------------------------------------------------
revno: 9602
committer: address@hidden
branch nick: rtmp
timestamp: Wed 2008-08-27 19:20:30 -0600
message:
Rename Que to que_t.
modified:
libnet/cque.cpp
libnet/cque.h
=== modified file 'libnet/cque.cpp'
--- a/libnet/cque.cpp 2008-08-14 04:24:41 +0000
+++ b/libnet/cque.cpp 2008-08-28 01:20:30 +0000
@@ -30,10 +30,10 @@
#include "buffer.h"
using namespace gnash;
+using namespace amf;
using namespace std;
using namespace boost;
-
namespace gnash
{
@@ -53,7 +53,7 @@
{
// GNASH_REPORT_FUNCTION;
// clear();
- Que::iterator it;
+ que_t::iterator it;
boost::mutex::scoped_lock lock(_mutex);
for (it = _que.begin(); it != _que.end(); it++) {
amf::Buffer *ptr = *(it);
@@ -93,7 +93,7 @@
bool
CQue::push(amf::Buffer *data)
{
-// GNASH_REPORT_FUNCTION;
+ GNASH_REPORT_FUNCTION;
boost::mutex::scoped_lock lock(_mutex);
_que.push_back(data);
#ifdef USE_STATS_QUEUE
@@ -198,25 +198,22 @@
CQue::merge(amf::Buffer *start)
{
// Find iterator to first element to merge
- Que::iterator from = std::find(_que.begin(), _que.end(), start);
- if ( from == _que.end() ) {
+ que_t::iterator from = std::find(_que.begin(), _que.end(), start);
+ if (from == _que.end()) {
// Didn't find the requested Buffer pointer
return NULL;
}
-
// Find iterator to last element to merge (first with size < NETBUFSIZE)
// computing total size with the same scan
size_t totalsize = (*from)->size();
- Que::iterator to=from; ++to;
- for (Que::iterator e=_que.end(); to!=e; ++to)
- {
+ que_t::iterator to=from; ++to;
+ for (que_t::iterator e=_que.end(); to!=e; ++to) {
size_t sz = (*to)->size();
totalsize += sz;
if (sz < gnash::NETBUFSIZE) break;
}
- if ( to == _que.end() )
- {
+ if (to == _que.end()) {
// Didn't find an element ending the merge
return NULL;
}
@@ -225,8 +222,7 @@
std::auto_ptr<amf::Buffer> newbuf ( new amf::Buffer(totalsize) );
Network::byte_t *tmp = newbuf->reference();
++to;
- for (Que::iterator i=from; i!=to; ++i)
- {
+ for (que_t::iterator i=from; i!=to; ++i) {
amf::Buffer *buf = *i;
size_t sz = buf->size();
std::copy(buf->reference(), buf->reference() + sz, tmp);
@@ -239,12 +235,12 @@
}
// Finally erase all merged elements, and replace with the composite one
- Que::iterator nextIter = _que.erase(from, to);
+ que_t::iterator nextIter = _que.erase(from, to);
_que.insert(nextIter, newbuf.get());
return newbuf.release(); // ownership is transferred. TODO: return auto_ptr
}
-
+
// Dump internal data.
void
CQue::dump()
=== modified file 'libnet/cque.h'
--- a/libnet/cque.h 2008-08-14 04:24:41 +0000
+++ b/libnet/cque.h 2008-08-28 01:20:30 +0000
@@ -35,6 +35,7 @@
class CQue {
public:
+ typedef std::deque<amf::Buffer *> que_t;
#ifdef USE_STATS_QUEUE
typedef struct {
struct timespec start;
@@ -76,12 +77,12 @@
que_stats_t *stats() { return &_stats; };
#endif
void setName(const std::string &str) { _name = str; }
+ const std::string &getName() { return _name; }
private:
// an optional name for the queue, only used for debugging messages to
make them unique
std::string _name;
// The queue itself
- typedef std::deque<amf::Buffer *> Que;
- Que _que;
+ que_t _que;
// A condition variable used to signal the other thread when the que has
data
boost::condition _cond;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gnash-commit] /srv/bzr/gnash/rtmp r9602: Rename Que to que_t.,
rob <=