20.01.2015 Views

Advanced Preprocessor Meta- Programming with Boost ...

Advanced Preprocessor Meta- Programming with Boost ...

Advanced Preprocessor Meta- Programming with Boost ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

struct TlvHandler<br />

{<br />

byte tag_;<br />

void (*parser_)(const byte *);<br />

};<br />

struct TlvHandlerMap<br />

{<br />

const TlvHandler *begin() const<br />

{<br />

return table_;<br />

}<br />

const TlvHandler *end() const<br />

{<br />

return table_ + size_;<br />

}<br />

const TlvHandler *table_;<br />

size_t<br />

size_;<br />

};<br />

struct TlvProcessor<br />

{<br />

void Process(const byte *begin, const byte *end) const;<br />

static const TlvHandlerMap map_;<br />

};<br />

Confidential ©NDS Ltd 2009. All rights reserved.<br />

TlvProcessor<br />

Object design<br />

always should<br />

come first (need to<br />

know which code<br />

to generate)

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!