Ignore:
Timestamp:
Apr 24, 2012, 7:37:05 PM (7 years ago)
Author:
ksherdy
Message:

Refactored symbol table design to support div2, log2.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/symbol_table/main_template.cpp

    r2029 r2052  
    3232#include "transpose.hpp"
    3333#include "buffer.hpp"
     34#include "gid.hpp"
    3435#include "../lib/bitblock.hpp"
    3536#include "../lib/allocator.hpp"
     
    4041#include "hash_strms.hpp"       // GENERATED HEADER
    4142#include "id_group_strms.hpp"   // GENERATED HEADER
    42 #include "id_symbol_table.hpp"
     43#include "symbol_table.hpp"
    4344#include <string>
    4445#include <iostream>
     
    127128
    128129    Symbol symbols(SYMBOL_COUNT);
    129     id_symbol_table<Symbol, fast_pool_allocator<1024> > symbol_table;
     130    symbol_table<Symbol, fast_pool_allocator<1024> > st;
    130131
    131132    is.read ((char *)raw_buffer, SEGMENT_SIZE);
     
    152153
    153154      PERF_SEC_START(parser_timer);
    154       symbol_table.resolve(raw_buffer, groups, starts, ends_gte_17, h0, h1, SEGMENT_BLOCKS, symbols /*, SYMBOL_COUNT*/);
     155      st.resolve(raw_buffer, groups, starts, ends_gte_17, h0, h1, SEGMENT_BLOCKS, symbols /*, SYMBOL_COUNT*/);
    155156      PERF_SEC_END(parser_timer, SEGMENT_SIZE);
    156157
     
    179180                                while(!fscanner.is_done()) {
    180181                                        gid = symbols.gids[fscanner.get_pos() + blk_offset];
    181                                         cout << string((char *)symbol_table.get_raw_data(gid), symbol_table.get_lgth(gid)) << ",";
     182                                        cout << string((char *)st.get_raw_data(gid), st.get_lgth(gid)) << ",";
    182183                                        fscanner.scan_to_next();
    183184                                }
     
    221222
    222223    //PERF_SEC_START(parser_timer);
    223     symbol_table.resolve(raw_buffer, groups, starts, ends_gte_17, h0, h1, segment_size, symbols/*, SYMBOL_COUNT*/);
     224    st.resolve(raw_buffer, groups, starts, ends_gte_17, h0, h1, segment_size, symbols/*, SYMBOL_COUNT*/);
    224225    //PERF_SEC_END(parser_timer, chars_avail+1);
    225226
     
    233234                        while(!fscanner.is_done()) {
    234235                                gid = symbols.gids[fscanner.get_pos() + blk_offset];
    235                                 cout << string((char *)symbol_table.get_raw_data(gid), symbol_table.get_lgth(gid)) << ",";
     236                                cout << string((char *)st.get_raw_data(gid), st.get_lgth(gid)) << ",";
    236237                                fscanner.scan_to_next();
    237238                        }
Note: See TracChangeset for help on using the changeset viewer.