Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
.NETのTuple応用チャレンジ WCFとC++/CLI
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
suusanex
April 17, 2019
Programming
0
160
.NETのTuple応用チャレンジ WCFとC++/CLI
.NETのTuple(ValueTuple)を、WCFで使えるか。そして、C++/CLIからは呼べるのか。これを実験してみました。
suusanex
April 17, 2019
Tweet
Share
More Decks by suusanex
See All by suusanex
Azure DevTestLabsはデスクトップアプリ開発のテストを楽にしてくれる
suusanex
1
37
Other Decks in Programming
See All in Programming
Claude Code の Skill で複雑な既存仕様をすっきり整理しよう
yuichirokato
1
370
RubyとGoでゼロから作る証券システム: 高信頼性が求められるシステムのコードの外側にある設計と運用のリアル
free_world21
0
270
CSC307 Lecture 13
javiergs
PRO
0
320
どんと来い、データベース信頼性エンジニアリング / Introduction to DBRE
nnaka2992
1
280
DevinとClaude Code、SREの現場で使い倒してみた件
karia
1
1k
コーディングルールの鮮度を保ちたい / keep-fresh-go-internal-conventions
handlename
0
200
new(1.26) ← これすき / kamakura.go #8
utgwkk
0
2.3k
Ruby x Terminal
a_matsuda
7
590
AHC061解説
shun_pi
0
370
Goの型安全性で実現する複数プロダクトの権限管理
ishikawa_pro
2
310
CDIの誤解しがちな仕様とその対処TIPS
futokiyo
0
210
社内規程RAGの精度を73.3% → 100%に改善した話
oharu121
13
8k
Featured
See All Featured
Build your cross-platform service in a week with App Engine
jlugia
234
18k
Exploring anti-patterns in Rails
aemeredith
2
290
Evolving SEO for Evolving Search Engines
ryanjones
0
150
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
120
Marketing to machines
jonoalderson
1
5k
AI: The stuff that nobody shows you
jnunemaker
PRO
3
380
The Cult of Friendly URLs
andyhume
79
6.8k
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
190
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
118
110k
How Software Deployment tools have changed in the past 20 years
geshan
0
32k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.6k
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
1
140
Transcript
.NETのTuple応用チャレンジ WCFとC++/CLI 須藤圭太
自己紹介 • ID:suusanex( connpass・Twitter・GitHub共通) • 名前:須藤圭太 • サイエンスパーク株式会社という独立系ソフトウェアベンダーに所属 • 4年ほど受託開発で、上流から下流まで全部を回す
• ここ6年ほどは、自社製品開発を担当 • 勉強会、今後も開いていきます。次は5/14! • 今回は「Driver Module Framework(DMF)、VS静的解析、RPCデ バッグ等」やります • https://sciencepark.connpass.com/event/126600/ • https://sciencepark.connpass.com/
Tupleとは • 複数の変数をまとめた型を、一時的に作れる • 戻り値の例 • (int retInt, string retString)Func();
• var ret = Func(); • ret.retInt; • 匿名型と違って、変数名がIntellisenseとコンパイルの対象になる • タイポしない!
応用:WCFのSOAP通信にも使えるか? • まだサポートが続いている.NET 4.5.2で実験 • 4.6以前を使う場合、NuGetでライブラリ追加が必要
• 戻り値にTupleを使ってみて、問題なくコンパイルが通った
• SOAP通信に成功、ちゃんとTupleで戻り値が取得できた • XMLの中ではItem1,Item2といった形で並んでいる <FuncResult xmlns:d4p1="http://schemas.datacontract.org/2004/07/System" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"> <d4p1:Item1>1</d4p1:Item1> <d4p1:Item2>1になった理由</d4p1:Item2> </FuncResult>
C++/CLIから呼べるか? • 定義はC#で、C++/CLIのコンソールアプリから呼び出す • とりあえずは書ける。Tupleの型が扱えないので、NuGetで取得
• NuGetで参照エラー • 直接参照でチャレンジ
• Tupleの変数が見れない • Item1,Item2だった(以前からあるGeneric版?) • 動いてはいるが、デバッグはできない
• .NET 4.7.2の組み込みTupleを使っても、結果は同じ
まとめ • TupleはWCFのSOAP通信にも使える • C++/CLIでも、一応使える(変数名が見れないが) • プロセス間通信のI/Fにもどんどん使っていって良さそう