diff options
author | Hanoh Haim <hhaim@cisco.com> | 2015-11-16 21:02:43 +0200 |
---|---|---|
committer | Hanoh Haim <hhaim@cisco.com> | 2015-11-16 21:02:43 +0200 |
commit | aa9bf54e6f892168482ed647a0e67ab10b1cf34a (patch) | |
tree | 679211e3d4bfbaba46e38970b0c49f768f69e188 /src/stateless/cp/trex_streams_compiler.h | |
parent | 3b8eb91e17f8f4647b4ba9a78ba485f5c490bfac (diff) | |
parent | d16ebf0b67ae8e339fd9367c313a786a8172b1b0 (diff) |
Merge from master
Diffstat (limited to 'src/stateless/cp/trex_streams_compiler.h')
-rw-r--r-- | src/stateless/cp/trex_streams_compiler.h | 34 |
1 files changed, 25 insertions, 9 deletions
diff --git a/src/stateless/cp/trex_streams_compiler.h b/src/stateless/cp/trex_streams_compiler.h index 78ac1ac7..42cfc5b8 100644 --- a/src/stateless/cp/trex_streams_compiler.h +++ b/src/stateless/cp/trex_streams_compiler.h @@ -23,9 +23,11 @@ limitations under the License. #include <stdint.h> #include <vector> +#include <string> class TrexStreamsCompiler; class TrexStream; +class GraphNodeMap; /** * compiled object for a table of streams @@ -48,13 +50,6 @@ public: return m_objs; } - void set_simulation_duration(double duration){ - m_duration_sim=duration; - } - - double get_simulation_duration(){ - return (m_duration_sim); - } /** * clone the compiled object * @@ -71,18 +66,39 @@ private: uint8_t m_port_id; double m_mul; - double m_duration_sim; /* duration for all simulation */ }; class TrexStreamsCompiler { public: + /** * compiles a vector of streams to an object passable to the DP * * @author imarom (28-Oct-15) * */ - bool compile(const std::vector<TrexStream *> &streams, TrexStreamsCompiledObj &obj); + bool compile(const std::vector<TrexStream *> &streams, TrexStreamsCompiledObj &obj, std::string *fail_msg = NULL); + + /** + * + * returns a reference pointer to the last compile warnings + * if no warnings were produced - the vector is empty + */ + const std::vector<std::string> & get_last_compile_warnings() { + return m_warnings; + } + +private: + + void pre_compile_check(const std::vector<TrexStream *> &streams); + void allocate_pass(const std::vector<TrexStream *> &streams, GraphNodeMap *nodes); + void direct_pass(GraphNodeMap *nodes); + void check_for_unreachable_streams(GraphNodeMap *nodes); + void check_stream(const TrexStream *stream); + void add_warning(const std::string &warning); + void err(const std::string &err); + + std::vector<std::string> m_warnings; }; #endif /* __TREX_STREAMS_COMPILER_H__ */ |