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
suusanex
April 17, 2019
Programming
0
150
.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
35
Other Decks in Programming
See All in Programming
Hypervel - A Coroutine Framework for Laravel Artisans
albertcht
1
110
なぜ「共通化」を考え、失敗を繰り返すのか
rinchoku
1
640
スタートアップの急成長を支えるプラットフォームエンジニアリングと組織戦略
sutochin26
0
4.1k
AI時代のソフトウェア開発を考える(2025/07版) / Agentic Software Engineering Findy 2025-07 Edition
twada
PRO
64
20k
Azure AI Foundryではじめてのマルチエージェントワークフロー
seosoft
0
160
20250704_教育事業におけるアジャイルなデータ基盤構築
hanon52_
5
680
ニーリーにおけるプロダクトエンジニア
nealle
0
780
データの民主化を支える、透明性のあるデータ利活用への挑戦 2025-06-25 Database Engineering Meetup#7
y_ken
0
340
関数型まつりレポート for JuliaTokai #22
antimon2
0
160
XP, Testing and ninja testing
m_seki
3
230
#kanrk08 / 公開版 PicoRubyとマイコンでの自作トレーニング計測装置を用いたワークアウトの理想と現実
bash0c7
1
690
PipeCDのプラグイン化で目指すところ
warashi
1
260
Featured
See All Featured
Gamification - CAS2011
davidbonilla
81
5.3k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
138
34k
StorybookのUI Testing Handbookを読んだ
zakiyama
30
5.9k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
46
9.6k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.4k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
30
2.1k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
331
22k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
10
950
Why Our Code Smells
bkeepers
PRO
337
57k
The Invisible Side of Design
smashingmag
301
51k
GitHub's CSS Performance
jonrohan
1031
460k
Art, The Web, and Tiny UX
lynnandtonic
299
21k
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にもどんどん使っていって良さそう