magistraleinformaticanetworking:spm:supportorec17
Differenze
Queste sono le differenze tra la revisione selezionata e la versione attuale della pagina.
Entrambe le parti precedenti la revisioneRevisione precedenteProssima revisione | Revisione precedente | ||
magistraleinformaticanetworking:spm:supportorec17 [17/10/2017 alle 16:39 (8 anni fa)] – Marco Danelutto | magistraleinformaticanetworking:spm:supportorec17 [25/01/2018 alle 14:17 (7 anni fa)] (versione attuale) – [Course notes] Marco Danelutto | ||
---|---|---|---|
Linea 11: | Linea 11: | ||
Next lessons will be on Tuesday Oct. 3, 11am Room X1 and Tuesday Oct. 3 14pm in the multimedia room (Dept. of Computer Science). | Next lessons will be on Tuesday Oct. 3, 11am Room X1 and Tuesday Oct. 3 14pm in the multimedia room (Dept. of Computer Science). | ||
+ | ==== Course notes ==== | ||
+ | Course notes (last edition) may be found [[http:// | ||
+ | |||
+ | ==== Trivial ff_comp implementation ==== | ||
+ | In case, you may use this code to implement a trivial ff_comp that **only accepts sequential stages**. | ||
+ | |||
+ | <code " | ||
+ | #ifndef ff_comp_hpp | ||
+ | #define ff_comp_hpp | ||
+ | |||
+ | #include < | ||
+ | #include < | ||
+ | #include < | ||
+ | #include < | ||
+ | |||
+ | using namespace ff; | ||
+ | |||
+ | |||
+ | class ff_comp : public ff_node { | ||
+ | protected: | ||
+ | std:: | ||
+ | int stageno; | ||
+ | public: | ||
+ | |||
+ | ff_comp(ff_node *s1, ff_node *s2) { | ||
+ | stages.push_back(s1); | ||
+ | stages.push_back(s2); | ||
+ | stageno = 2; | ||
+ | } | ||
+ | |||
+ | ff_comp(std:: | ||
+ | stageno = 0; | ||
+ | for(auto i = pats.begin(); | ||
+ | stages.push_back(*i); | ||
+ | stageno++; | ||
+ | } | ||
+ | } | ||
+ | |||
+ | |||
+ | // for cloning | ||
+ | |||
+ | ff_comp() { | ||
+ | stageno=0; | ||
+ | return; | ||
+ | } | ||
+ | |||
+ | void add_stage(ff_node * stage) { | ||
+ | stages.push_back(stage); | ||
+ | stageno++; | ||
+ | return; | ||
+ | } | ||
+ | |||
+ | ff_comp * clone() { | ||
+ | ff_comp * p = new ff_comp(); | ||
+ | for(int i=0; i< | ||
+ | p-> | ||
+ | return(p); | ||
+ | } | ||
+ | // end of bad idea to clone | ||
+ | |||
+ | void * svc (void * t) { | ||
+ | auto x = stages[0]-> | ||
+ | for(int i=1; i< | ||
+ | x = stages[i]-> | ||
+ | return(x); | ||
+ | } | ||
+ | }; | ||
+ | </ | ||
====== Support material 2017 (recovery edition) ====== | ====== Support material 2017 (recovery edition) ====== | ||
Linea 35: | Linea 103: | ||
| spm17c15 | Cosimo Agati | | | spm17c15 | Cosimo Agati | | ||
| spm17c16 | Elena Bucchianeri | | | spm17c16 | Elena Bucchianeri | | ||
+ | | spm17c17 | Maria Chiara Cecconi | | ||
+ | | spm17c18 | Equi Massimo | | ||
magistraleinformaticanetworking/spm/supportorec17.1508258376.txt.gz · Ultima modifica: 17/10/2017 alle 16:39 (8 anni fa) da Marco Danelutto