00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef _CJNP_PAJEKDUMP_H_
00021 #define _CJNP_PAJEKDUMP_H_ 1
00022
00023 #include <string>
00024 #include <stdexcept>
00025 #include "CjNetworkProcess.hh"
00026
00027 namespace jmitie {
00028 namespace corelib {
00029 class CjNP_pajekDump : public CjNetworkProcess {
00030
00031 public:
00032 std::string getName() const { return getName_static(); }
00033 static std::string getName_static() { return "pajekDump"; }
00034 std::string getProperty(const std::string & prop) const { return getProperty_static(prop); }
00035 static std::string getProperty_static(const std::string & opt) {
00036 if(opt=="desc") return "Output the topology to a Pajek file.";
00037 if(opt=="usage") return getProperty_static("desc") + "\nAvailable options:\nfn_base=file_prefix [fn_ext=ext] [overwrite]\n\tfn_base=\tSpecifies the start of the filename\n\tfn_ext=\tSpecifies the file extension\n\toverwrite\tSpecifies that the file can be overwritten.\ne.g. 0:" + getName_static() + "{fn_base=expt1_,fn_ext=.net}\tWill output the topology at every epoch to a file called expt1_#####.net where ##### is the epoch number.\n";
00038 throw std::invalid_argument("CjNP_pajekDump::getProperty_static(" + opt + "): Unknown property requested.");
00039 }
00040
00041 CjNP_pajekDump(const std::string & args, const ctor_va_t & var_arg );
00042 virtual void performAction( const action_va_t & opts );
00043
00044 ~CjNP_pajekDump();
00045
00046 protected:
00047 std::string m_fname_base;
00048 std::string m_fname_ext;
00049 bool m_overwrite;
00050
00051 };
00052 }
00053 }
00054
00055 #endif // _CJNP_PAJEKDUMP_H_