主题:这样使用#define的目的是什么?
simkerneldefs.h代码如下:
#define OMNETPP_VERSION 0x0401
#if defined(SIM_EXPORT)
# define SIM_API OPP_DLLEXPORT
#elif defined(SIM_IMPORT) || defined(OMNETPPLIBS_IMPORT)
# define SIM_API OPP_DLLIMPORT
#else
# define SIM_API
#endif
cenum.h代码如下:
class SIM_API cEnum : public cOwnedObject //这里插入SIM_API的意义是什么
{
private:
std::map<int,std::string> valueToNameMap;
std::map<std::string,int> nameToValueMap;
std::vector<std::string> tmpNames;
public:
// internal: helper for the Register_Enum() macro
cEnum *registerNames(const char *nameList);
// internal: helper for the Register_Enum() macro
cEnum *registerValues(int first, ...);
public:
/** @name Constructors, destructor, assignment. */
//@{
cEnum(const char *name=NULL);
cEnum(const cEnum& cenum);
virtual ~cEnum();
cEnum& operator=(const cEnum& list);
//@}
//@{
virtual cEnum *dup() const {return new cEnum(*this);}
virtual std::string info() const;
//@}
void insert(int value, const char *name);
const char *getStringFor(int value);
int lookup(const char *name, int fallback=-1);
//@}
std::string str() const;
static cEnum *find(const char *name);
static cEnum *get(const char *name);
};
NAMESPACE_END
#endif
在类名前加入SIM_API的目的是什么?
class SIM_API cEnum : public cOwnedObject //这里插入SIM_API的意义是什么
各位大侠指点一二啊