More Related Content
PDF
30億のデバイスで走るjavaを支えるjavaエコシステム PPTX
burikaigi2025.pptx Burikaigi2025でつかった資料です。 PPTX
DotNetConf2024の資料 BlazorとLowCodeと生成AIの話です PDF
2024/07/04 Blazor+ローコードで実現する.NET資産のモダナイズ PPTX
PPT
20130927 perlbeginners 10 time-piece PPTX
【オンライン】.NET 6 移行祭り! C# Tokyo イベント PPTX
More from Tatsuya Ishikawa
PPTX
メタな感じのプログラミング(プロ生 + わんくま 071118) PPTX
PPTX
Infragistics Web Day 2017 - 継続的な開発を支える テスト自動化技術 PPTX
PPTX
Windowsアプリテスト自動化 [Friendly+delphi] PPTX
PPTX
Friendlyを使ったwindowsアプリテスト自動化 PDF
PPTX
Friendlyで始めるwindowsアプリシステムテスト自動化+内部使用技術解説 PPTX
PPTX
Test automation strategy for .net core 3 transition PPTX
PPTX
【SQiP2014】システム操作インターフェイス最適化によるテスト自動化ROI向上 PPTX
Bindingからframework elementを見つける PPTX
PPTX
PPTX
PPTX
価値あるシステムテスト自動化の実現By friendly PDF
私とC++ in 例外安全day
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.
- 7.
- 8.
- 9.
- 10.
- 11.
- 12.
- 13.
- 14.
- 15.
- 16.
- 17.
- 18.
- 19.
- 20.
- 21.
- 22.
- 23.
- 24.
- 25.
- 26.
- 27.
- 28.
- 29.
- 30.
- 31.
- 32.
- 33.
- 34.
private:
static T* __stdcallNewCore(unsigned int size)
{
return new T[size];
}
static void __stdcall DeleteCore(T* ptr)
{
if (ptr)
{
delete[] ptr;
}
}
};
- 35.
- 36.
- 37.
- 38.
- 39.
- 40.
template <typename Ret,int fileNo, int lineNo>
struct AOPLog {
//DLL関数の型
typedef Ret (__stdcall *FuncType)();
//ログ
static std::string& Log()
{ static std::string log; return log; }
//DLL関数
static FuncType& Func()
{ static FuncType func; return func; }
//ログ出力と呼び出し
static Ret __stdcall Invoke()
{ Print(Log()); return Func(); }
};
- 41.
//戻り値voidで特殊化
template <int fileNo,int lineNo>
struct AOPLog<void, fileNo, lineNo> {
typedef void(__stdcall *FuncType)();
static std::string& Log()
{ static std::string log; return log; }
static FuncType& Func()
{ static FuncType func; return func; }
static void __stdcall Invoke()
{ Print(Log()); Func(); }
};
- 42.
//ログ入り関数ロード
template<int fileNo, intlineNo, typename Ret>
void MakeLog(HMODULE h,
Ret (__stdcall *&func)(), LPCSTR name)
{
typedef AOPLog<Ret, fileNo, lineNo> T;
if (s_logMode) {
T::Func() =
(T::FuncType)::GetProcAddress(h,name);
T::Log() = funcName;
func = T::Invoke;
} else {
func = (T::FuncType)::GetProcAddress(h,name);
}
}
- 43.
- 44.