FREE Subscription to Dr. Dobb’s Digest: Same Great Content, New Digital Edition
Site Archive (Complete)
C++
Email
Print
Reprint

add to:
Del.icio.us
Digg
Google
Furl
Slashdot
Y! MyWeb
Blink
October 01, 2005

Bitstream Parsing in C++

(Page 5 of 10)

October, 2005: Bitstream Parsing in C++

Listing 2

class Mgt : public Composite {
 public:
    Mgt() : 
        Composite("Mgt")
    {
        Add(new Bitset("tableId",		8));
        Add(new Bitset("sectionSyntaxIndicator",	1));
        Add(new Bitset("privateIndicator",	1));
        Add(new Bitset("reserved2a",		2));
        Add(new Bitset("sectionLength",	12));
        Add(new Bitset("tableIdExtention",	16));
        Add(new Bitset("reserved2b",		2));
        Add(new Bitset("versionNumber",	5));
        Add(new Bitset("currentNextIndicator",	1));
        Add(new Bitset("sectionNumber",	8));
        Add(new Bitset("lastSectionNumber",	8));
        Add(new Bitset("protocolVersion",	8));                
        Add(new Bitset("tablesDefined",	16));
        Add(new List  ("tables",                 LIST_INFO(MgtDefinedTable, 
                                                 Mgt, KeepReadingTables)));
        Add(new Bitset("reserved4",		4));
        Add(new Bitset("descriptorsLength",	12));
        Add(new List  ("descriptors",
         LIST_INFO(SIDescriptor, Mgt, KeepReadingDescriptors)));
        Add(new Bitset("crc",		32));
    }
 private:
    bool KeepReadingTables() {
        return Value("tables") < Value("tablesDefined");
    }
    bool KeepReadingDescriptors() {
        return SizeInBytes("descriptors") < Value("descriptorsLength");
    }
};

Previous Page | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 Next Page
TOP 5 ARTICLES
No Top Articles.



MICROSITES
FEATURED TOPIC

ADDITIONAL TOPICS

INFO-LINK