#include "Vfs.h"
-void dmlite::vfsThrowHelper(const std::string& func, int code, const std::string& msg) throw (DmException) {
- throw DmException(code, "VfsCatalog::" + func + "(): " + msg);
+void dmlite::vfsThrowHelper(const std::string &classname, const std::string& func, int code, const std::string& msg) throw (DmException) {
+ throw DmException(code, classname + "::" + func + "(): " + msg);
}
-int dmlite::vfsWrapCallHelper(const std::string &func, int r, const std::string& msg) throw (DmException) {
+int dmlite::vfsWrapCallHelper(const std::string &classname, const std::string &func, int r, const std::string& msg) throw (DmException) {
if (r < 0) {
if (msg.length() != 0)
- vfsThrowHelper(func, errno, msg + ": " + strerror(errno));
+ vfsThrowHelper(classname, func, errno, msg + ": " + strerror(errno));
else
- vfsThrowHelper(func, errno, strerror(errno));
+ vfsThrowHelper(classname, func, errno, strerror(errno));
}
return r;
}
-void *dmlite::vfsWrapCallHelper(const std::string &func, void *p, const std::string& msg) throw (DmException) {
+void *dmlite::vfsWrapCallHelper(const std::string &classname, const std::string &func, void *p, const std::string& msg) throw (DmException) {
if (!p) {
if (msg.length() != 0)
- vfsThrowHelper(func, errno, msg + ": " + strerror(errno));
+ vfsThrowHelper(classname, func, errno, msg + ": " + strerror(errno));
else
- vfsThrowHelper(func, errno, strerror(errno));
+ vfsThrowHelper(classname, func, errno, strerror(errno));
}
return p;
}
#include <dmlite/cpp/io.h>
#include <dmlite/cpp/poolmanager.h>
-#define vfsThrowErrno(MSG) dmlite::vfsThrowHelper(__func__, DMLITE_SYSERR(errno), (MSG))
-#define vfsThrow(CODE, MSG) dmlite::vfsThrowHelper(__func__, (CODE), (MSG))
+#define vfsThrowErrno(MSG) dmlite::vfsThrowHelper(getImplId(), __func__, DMLITE_SYSERR(errno), (MSG))
+#define vfsThrow(CODE, MSG) dmlite::vfsThrowHelper(getImplId(), __func__, (CODE), (MSG))
#ifdef __GNUC__
- #define wrapCall(RETVAL, MSG...) dmlite::vfsWrapCallHelper(__func__, (RETVAL) , ##MSG)
+ #define wrapCall(RETVAL, MSG...) dmlite::vfsWrapCallHelper(getImplId(), __func__, (RETVAL) , ##MSG)
#else
- #define wrapCall(RETVAL, ...) dmlite::vfsWrapCallHelper(__func__, (RETVAL) , ##__VA_ARGS__)
+ #define wrapCall(RETVAL, ...) dmlite::vfsWrapCallHelper(getImplId(), __func__, (RETVAL) , ##__VA_ARGS__)
#endif
namespace dmlite {
std::string tokenPasswd_;
bool tokenUseIp_;
unsigned tokenLife_;
+
+ private:
+ std::string getImplId(void) const throw ();
};
- void vfsThrowHelper(const std::string& func, int code, const std::string& msg = "") throw (DmException);
- int vfsWrapCallHelper(const std::string &func, int r, const std::string& msg = "") throw (DmException);
- void *vfsWrapCallHelper(const std::string &func, void *p, const std::string& msg = "") throw (DmException);
+ void vfsThrowHelper(const std::string &classname, const std::string& func, int code, const std::string& msg = "") throw (DmException);
+ int vfsWrapCallHelper(const std::string &classname, const std::string &func, int r, const std::string& msg = "") throw (DmException);
+ void *vfsWrapCallHelper(const std::string &classname, const std::string &func, void *p, const std::string& msg = "") throw (DmException);
};