source: icGREP/icgrep-devel/icgrep/cc/multiplex_CCs.h @ 5836

Last change on this file since 5836 was 5836, checked in by nmedfort, 15 months ago

Added PabloBlock/Builder? createScope() methods + minor code changes.

File size: 1.3 KB
RevLine 
[5369]1/*
2 *  Copyright (c) 2017 International Characters.
3 *  This software is licensed to the public under the Open Software License 3.0.
4 */
5#ifndef MULTIPLEX_CCS_H
6#define MULTIPLEX_CCS_H
7
8#include <vector>
[5795]9#include <cc/alphabet.h>
[5369]10
[5748]11namespace re { class CC; }
[5369]12
[5795]13namespace cc {
[5748]14
[5795]15class MultiplexedAlphabet : public Alphabet {
16public:
17    MultiplexedAlphabet(std::string alphabetName, const std::vector<const re::CC *> CCs);
[5800]18    static inline bool classof(const Alphabet * a) {
19        return a->getClassTypeId() == ClassTypeId::MultiplexedAlphabet;
20    }
21    static inline bool classof(const void *) {return false;}
[5816]22   
23    const unsigned getSize() const override {return mUnicodeSets.size() + 1;}
[5800]24
[5836]25    const Alphabet * getSourceAlphabet() const {
26        return mSourceAlphabet;
27    }
[5795]28   
[5836]29    const std::vector<std::vector<unsigned>> & getExclusiveSetIDs() const {
30        return mExclusiveSetIDs;
31    }
[5795]32   
[5836]33    const std::vector<re::CC *> & getMultiplexedCCs() const {
34        return mMultiplexedCCs;
35    }
[5799]36   
[5801]37    re::CC * transformCC(const re::CC * sourceCC) const;
38   
39    re::CC * invertCC(const re::CC * transformedCC) const;
[5795]40private:
[5799]41    const Alphabet * mSourceAlphabet;
42    const std::vector<const re::CC *> mUnicodeSets;
[5795]43    std::vector<std::vector<unsigned>> mExclusiveSetIDs;
44    std::vector<re::CC *> mMultiplexedCCs;
45};
46}
[5369]47
[5795]48
[5369]49#endif
Note: See TracBrowser for help on using the repository browser.