bsonobjiterator.h File Reference

#include <boost/preprocessor/cat.hpp>
Include dependency graph for bsonobjiterator.h:

Go to the source code of this file.

Classes

class  mongo::BSONObjIterator
class  mongo::BSONObjIteratorSorted

Namespaces

namespace  mongo

Defines

#define BSONForEach(e, obj)

Define Documentation

#define BSONForEach ( e,
obj   ) 
Value:
BSONObjIterator BOOST_PP_CAT(it_,__LINE__)(obj);            \
    for ( BSONElement e;                                        \
            (BOOST_PP_CAT(it_,__LINE__).more() ?                  \
             (e = BOOST_PP_CAT(it_,__LINE__).next(), true) :  \
             false) ;                                         \
            /*nothing*/ )

Similar to BOOST_FOREACH

because the iterator is defined outside of the for, you must use {} around the surrounding scope. Don't do this:

if (foo) BSONForEach(e, obj) doSomething(e);

but this is OK:

if (foo) { BSONForEach(e, obj) doSomething(e); }

Definition at line 123 of file bsonobjiterator.h.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines


mongodb
Author(s): Nate Koenig
autogenerated on Fri Jan 11 12:15:19 2013