| 1 |
// SourceDest.h |
| 2 |
// |
| 3 |
// Added by Johannes Hjorth, 2008 |
| 4 |
// |
| 5 |
// Feel free to use the code, have fun! |
| 6 |
// |
| 7 |
// Based on the KeyValue-code |
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
#ifndef INCLUDED_SourceDest_H |
| 13 |
#define INCLUDED_SourceDest_H |
| 14 |
|
| 15 |
#ifndef INCLUDED_DataLine_H |
| 16 |
#include "DataLine.h" |
| 17 |
#endif |
| 18 |
|
| 19 |
#ifndef INCLUDED_STRING |
| 20 |
#include <string> |
| 21 |
#define INCLUDED_STRING |
| 22 |
#endif |
| 23 |
|
| 24 |
#ifndef INCLUDED_IOSTREAM |
| 25 |
#include <iostream> |
| 26 |
#define INCLUDED_IOSTREAM |
| 27 |
#endif |
| 28 |
|
| 29 |
namespace rude{ |
| 30 |
namespace config{ |
| 31 |
//= |
| 32 |
// SourceDest represents message passing from Source to Dest |
| 33 |
// |
| 34 |
// app1.source -> dest |
| 35 |
// dest <- app2.source |
| 36 |
// app2.dest <- source |
| 37 |
// |
| 38 |
|
| 39 |
class SourceDest: public DataLine{ |
| 40 |
|
| 41 |
|
| 42 |
std::string d_srcApp; |
| 43 |
std::string d_srcObj; |
| 44 |
std::string d_destApp; |
| 45 |
std::string d_destObj; |
| 46 |
std::string d_width; |
| 47 |
std::string d_comment; |
| 48 |
/* remedius |
| 49 |
* <collective> or <point-to-point> |
| 50 |
*/ |
| 51 |
std::string d_commType; |
| 52 |
/* remedius |
| 53 |
* <tree> or <table> |
| 54 |
*/ |
| 55 |
std::string d_procMethod; |
| 56 |
|
| 57 |
public: |
| 58 |
|
| 59 |
// default constructor |
| 60 |
SourceDest(); |
| 61 |
/* remedius |
| 62 |
* two more parameters: commType and procMethod were added due to the runtime opportunity |
| 63 |
* of choosing communication type and pre-/post-processing method. |
| 64 |
*/ |
| 65 |
SourceDest(const char *srcApp, const char *srcObj, const char *destApp, const char *destObj, |
| 66 |
const char *width, const char* commType, const char *procMethod, const char *comment); |
| 67 |
|
| 68 |
void acceptWriter(AbstractWriter& writer) const; |
| 69 |
std::string toString(); |
| 70 |
|
| 71 |
// |
| 72 |
const char *getSrcApp() const; |
| 73 |
const char *getSrcObj() const; |
| 74 |
const char *getDestApp() const; |
| 75 |
const char *getDestObj() const; |
| 76 |
const char *getWidth() const; |
| 77 |
/* remedius |
| 78 |
* |
| 79 |
*/ |
| 80 |
const char *getCommType() const; |
| 81 |
/* remedius |
| 82 |
* |
| 83 |
*/ |
| 84 |
const char *getProcMethod() const; |
| 85 |
|
| 86 |
//= |
| 87 |
// Returns the comment associated with the data member |
| 88 |
// Will return the comment even if the data member is flagged as being deleted |
| 89 |
// Always returns at least the empty string, will never return null. |
| 90 |
//= |
| 91 |
const char *getComment() const; |
| 92 |
|
| 93 |
//= |
| 94 |
// Sets the name of the data member |
| 95 |
// Will set the name even if the data member is flagged as being deleted or a comment |
| 96 |
// Accepts null |
| 97 |
//= |
| 98 |
void setSrcApp(const char *name); |
| 99 |
void setSrcObj(const char *name); |
| 100 |
void setDestApp(const char *name); |
| 101 |
void setDestObj(const char *name); |
| 102 |
void setWidth(const char *name); |
| 103 |
/* remedius |
| 104 |
* |
| 105 |
*/ |
| 106 |
void setCommType(const char *commType); |
| 107 |
/* remedius |
| 108 |
* |
| 109 |
*/ |
| 110 |
void setProcMethod(const char *procMethod); |
| 111 |
|
| 112 |
//= |
| 113 |
// Sets the comment associated with the data member |
| 114 |
// Will set the comment even if the data member is flagged as being deleted |
| 115 |
// Accepts null |
| 116 |
//= |
| 117 |
void setComment(const char *comment); |
| 118 |
|
| 119 |
~SourceDest(); |
| 120 |
|
| 121 |
}; |
| 122 |
|
| 123 |
}} // end namespace rude::config |
| 124 |
|
| 125 |
#endif |
| 126 |
|