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

Last change on this file was 6184, checked in by nmedfort, 6 months ago

Initial version of PipelineKernel? + revised StreamSet? model.

File size: 1.4 KB
Line 
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 <cc/alphabet.h>
9
10namespace re { class CC; }
11
12namespace cc {
13
14class MultiplexedAlphabet final : public Alphabet {
15public:
16    MultiplexedAlphabet(const std::string alphabetName, const std::vector<re::CC *> CCs);
17
18    static inline bool classof(const Alphabet * a) {
19        return a->getClassTypeId() == ClassTypeId::MultiplexedAlphabet;
20    }
21    static inline bool classof(const void *) {return false;}
22   
23    const unsigned getSize() const override {return mUnicodeSets.size() + 1;}
24
25    const Alphabet * getSourceAlphabet() const {
26        return mSourceAlphabet;
27    }
28   
29    const std::vector<std::vector<unsigned>> & getExclusiveSetIDs() const {
30        return mExclusiveSetIDs;
31    }
32   
33    const std::vector<re::CC *> & getMultiplexedCCs() const {
34        return mMultiplexedCCs;
35    }
36   
37    re::CC * transformCC(const re::CC * sourceCC) const;
38   
39    re::CC * invertCC(const re::CC * transformedCC) const;
40private:
41    const Alphabet * mSourceAlphabet;
42    const std::vector<re::CC *> mUnicodeSets;
43    std::vector<std::vector<unsigned>> mExclusiveSetIDs;
44    std::vector<re::CC *> mMultiplexedCCs;
45
46    unsigned long findTargetCCIndex(const re::CC * sourceCC) const;
47};
48
49}
50
51
52#endif
Note: See TracBrowser for help on using the repository browser.