{"id":2027,"date":"2011-02-12T20:10:26","date_gmt":"2011-02-12T11:10:26","guid":{"rendered":"http:\/\/www.moonmile.net\/blog\/archives\/2027"},"modified":"2011-02-12T20:11:10","modified_gmt":"2011-02-12T11:11:10","slug":"%e3%83%ab%e3%82%a4%e3%82%b9%e3%81%af%e3%82%a2%e3%83%aa%e3%82%b9%e3%81%ab%e9%9b%bb%e8%a9%b1%e3%81%99%e3%82%8b","status":"publish","type":"post","link":"http:\/\/www.moonmile.net\/blog\/archives\/2027","title":{"rendered":"\u30eb\u30a4\u30b9\u306f\u30a2\u30ea\u30b9\u306b\u96fb\u8a71\u3059\u308b"},"content":{"rendered":"<p>\n\u8ab0\u304b\u304c\u4f7f\u3063\u305f\u3089\u30a2\u30ea\u30b9\u306b\u77e5\u3089\u305b\u308d | Moonmile Solutions Blog<br \/>\n<a href=\"http:\/\/www.moonmile.net\/blog\/archives\/2017\">http:\/\/www.moonmile.net\/blog\/archives\/2017<\/a><br \/>\n\u8ab0\u304b\u304c\u4f7f\u3063\u305f\u3089\u30a2\u30ea\u30b9\u306b\u77e5\u3089\u305b\u308d(2) | Moonmile Solutions Blog<br \/>\n<a href=\"http:\/\/www.moonmile.net\/blog\/archives\/2023\">http:\/\/www.moonmile.net\/blog\/archives\/2023<\/a>\n<\/p>\n<p>\n\u306a\u3068\u3053\u308d\u3067\u3001\u30a4\u30d9\u30f3\u30c8\u3092\u53d7\u4fe1\u3059\u308b\u30d1\u30bf\u30fc\u30f3\u3092\u66f8\u3044\u305f\u308f\u3051\u3067\u3059\u304c\u3001\u3053\u308c\u3092\u4f7f\u3046\u3068<b>\u96fb\u8a71<\/b>\u304c\u4f5c\u308c\u307e\u3059\u3002\u3044\u308f\u3086\u308b\u3001\n<\/p>\n<ul>\n<li>\u96fb\u8a71\u3092\u639b\u3051\u308b\u3068\u3044\u3046\u30b3\u30cd\u30af\u30b7\u30e7\u30f3<\/li>\n<li>\u96fb\u8a71\u3092\u53d7\u3051\u308b\u3068\u3044\u3046\u975e\u540c\u671f\u30a4\u30d9\u30f3\u30c8<\/li>\n<\/ul>\n<p>\n\u306a\u611f\u3058\u3067\u3059\u3002\u96fb\u8a71\u3092\u53d7\u3051\u308b\u3068\u304d\u306b\u306f\u3001\u96fb\u8a71\u756a\u3092\u3057\u3066\u3044\u308b\u8a33\u3067\u306f\u306a\u304f\u3066\uff08\u96fb\u8a71\u756a\u306e\u5834\u5408\u306f<b>\u30dd\u30fc\u30ea\u30f3\u30b0<\/b>\u306a\u8a33\u3067\u3059\u304c\uff09\u3001\u96fb\u8a71\u306e\u30d9\u30eb\u304c\u9cf4\u3063\u305f\u3089\u53d7\u8a71\u5668\u3092\u53d6\u308b\u3068\u3044\u3046\u3001\u975e\u540c\u671f\u7684\u306a\u30a4\u30d9\u30f3\u30c8\u306b\u306a\u308a\u307e\u3059\u3002\n<\/p>\n<pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\n\/\/ for \u30eb\u30a4\u30b9\u306f\u30a2\u30ea\u30b9\u306b\u96fb\u8a71\u3059\u308b\n\n#include &lt;string.h&gt;\n#include &lt;iostream&gt;\nusing namespace std;\n\nclass ITelephone {\nprotected:\n\tITelephone *_person;\npublic:\n\t\/\/ \u76f8\u624b\u5148\u3092\u767b\u9332\n\tvoid setPhone( ITelephone *person ) {\n\t\tthis-&gt;_person = person ;\n\t}\n\t\/\/ \u30c7\u30fc\u30bf\u3092\u9001\u4fe1\n\tvirtual void sendData( const void *data, int size ) {\n\t\tif ( _person != NULL ) {\n\t\t\t_person-&gt;onPhone(data,size);\n\t\t}\n\t}\n\t\/\/ \u30c7\u30fc\u30bf\u3092\u53d7\u4fe1\u3059\u308b\u4eee\u60f3\u95a2\u6570\n\tvirtual void onPhone( const void *data, int size ) = 0;\n};\n\nclass Person : public ITelephone\n{\npublic:\n\tchar _name&#x5B;30];\npublic:\n\tPerson( const char *name ) {\n\t\tstrcpy( _name, name );\n\t}\n\tvirtual void onPhone( const void *data, int size ) {\n\t\tcout &lt;&lt; &amp;quot;to &amp;quot; &lt;&lt; _name &lt;&lt; &amp;quot;: &amp;quot; &lt;&lt; (char*)data &lt;&lt; endl;\n\t}\n\tvirtual void sendData( const void *data, int size ) {\n\t\tcout &lt;&lt; &amp;quot;from &amp;quot; &lt;&lt; _name &lt;&lt; &amp;quot;: &amp;quot; &lt;&lt; (char*)data &lt;&lt; endl;\n\t\tITelephone::sendData( data, size );\n\t}\n};\n\nint main(void)\n{\n\tPerson alice(&amp;quot;alice&amp;quot;);\n\tPerson lewis(&amp;quot;lewis&amp;quot;);\n\n\t\/\/ \u30a2\u30ea\u30b9\u306b\u96fb\u8a71\u3092\u639b\u3051\u308b\u3002\n\tlewis.setPhone( &amp;alice );\n\tlewis.sendData( &amp;quot;hello i&#039;m lewis&amp;quot;, 0 );\n\n\treturn 0;\n}\n<\/pre>\n<p>\n\u3053\u308c\u3092\u5b9f\u884c\u3059\u308b\u3068\u3053\u3093\u306a\u611f\u3058\u3002\n<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\nD:\\work\\blog\\src\\alice&gt;a\nfrom lewis: hello i&#039;m lewis\nto alice: hello i&#039;m lewis\n<\/pre>\n<p>\n\u30eb\u30a4\u30b9\u304b\u3089\u30a2\u30ea\u30b9\u306b\u96fb\u8a71\u3092\u639b\u3051\u308b\u3068\u3001\u30a2\u30ea\u30b9\u306e onPhone \u30e1\u30bd\u30c3\u30c9\u304c\u547c\u3073\u51fa\u3055\u308c\u308b\u3068\u3044\u3046\u4ed5\u7d44\u307f\u3067\u3059\u3002<br \/>\n\u5b9f\u306f\u3001\u3053\u306e ITelephone \u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u306f\u3001Person \u3067\u7d99\u627f\u3057\u3066\u3044\u308b\u305f\u3081\u306b\u3001\n<\/p>\n<p>\n<b>\u4eba\u306b\u96fb\u8a71\u304c\u5185\u8535\u3055\u308c\u3066\u3044\u308b<\/b>\n<\/p>\n<p>\n\u3063\u3066\u610f\u5473\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u304c\uff57\u3001\u307e\u3001\u6c17\u306b\u305b\u305a\u306b\u30c3!!! \u5358\u7d14\u306b\u7d99\u627f\u3057\u305f\u307b\u3046\u304c\u3001\u6a5f\u80fd\u62e1\u5f35\u306f\u697d\u3060\u3068\u3044\u3046\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u6307\u5411\u306e\u843d\u3068\u3057\u7a74\u306b\u9665\u3063\u305f\u4f8b\u3067\u3059\u30022,3 \u6a5f\u80fd\u8ffd\u52a0\u3067\u3042\u308c\u3070\u3001\u3053\u306e\u3088\u3046\u306b\u76f4\u3067\u7d99\u627f\u3059\u308b\u307b\u3046\u304c\u3044\u3044\u306e\u3067\u3059\u304c\u3001\u3053\u308c\u306e\u6570\u304c\u5897\u3048\u3066\u3057\u307e\u3046\u5834\u5408\u306b\u306f\u3001\u59d4\u8b72\u3068\u3044\u3046\u5f62\u3067\u6a5f\u80fd\u3092\u5206\u96e2\u3057\u305f\u307b\u3046\u304c\u3088\u3044\u306e\u3067\u3059\u3002\n<\/p>\n<p>\n<b>\u4eba\u304c\u96fb\u8a71\u3092\u6301\u3063\u3066\u3044\u308b<\/b>\u30d1\u30bf\u30fc\u30f3\u306f\u6b21\u56de\u306b\u4f5c\u308a\u76f4\u3057\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u8ab0\u304b\u304c\u4f7f\u3063\u305f\u3089\u30a2\u30ea\u30b9\u306b\u77e5\u3089\u305b\u308d | Moonmile Solutions Blog http:\/\/www.moonmile.net\/blog\/archives\/2017 \u8ab0\u304b\u304c\u4f7f\u3063\u305f\u3089\u30a2\u30ea\u30b9\u306b\u77e5\u3089\u305b\u308d(2) | Moon &hellip; <a href=\"http:\/\/www.moonmile.net\/blog\/archives\/2027\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[22],"tags":[],"class_list":["post-2027","post","type-post","status-publish","format-standard","hentry","category-c"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"http:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/posts\/2027","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/comments?post=2027"}],"version-history":[{"count":1,"href":"http:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/posts\/2027\/revisions"}],"predecessor-version":[{"id":2028,"href":"http:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/posts\/2027\/revisions\/2028"}],"wp:attachment":[{"href":"http:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/media?parent=2027"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/categories?post=2027"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/tags?post=2027"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}