いろいろなテクニック.Nucleo と DISCO-F746 用.

Dependencies:   Array_Matrix mbed

Revision:
1:bbb9f0c3e523
Parent:
0:bb939e0bc6e2
--- a/main.cpp	Sun Oct 15 11:41:48 2017 +0000
+++ b/main.cpp	Wed Apr 10 06:32:33 2019 +0000
@@ -2,7 +2,9 @@
 //  使用例:Nucleo と DISCO-746 が対象
 //
 //  mbed 公式ライブラリリビジョン 153 で OK
-//  2017/10/15, Copyright (c) 2017 MIKAMI, Naoki
+//  mbed 公式ライブラリリビジョン 172 で OK
+//
+//  2019/04/10, Copyright (c) 2019 MIKAMI, Naoki
 //------------------------------------------------------------
 
 #include "mbed.h"
@@ -11,21 +13,22 @@
 //------------------------------------------------------------------------------
 //  以下で,行頭の「//」を削除して有効にした define 文 に対応する処理が実行される
 //
-//#define MY_MATH                 // 1. 算術関数の例
-//#define MY_SORT                 // 2. STL のソートの例
-//#define DYNAMIC_POLYMORPHISM    // 3. 実行時ポリモーフィズム
-//#define STL_VECTOR              // 4. STL の vecotr の例
-//#define MY_NEW                  // 5. new 演算子のメモリ割り当てエラーを検出の例
-//#define FUNCTION_OBJECT         // 6. function object の例
-//#define FUNCTION_POINTER        // 7. 関数ポインタの例
+//#define MY_MATH                     // 1. 算術関数の例
+//#define MY_SORT                     // 2. STL のソートの例
+//#define DYNAMIC_POLYMORPHISM        // 3. 実行時ポリモーフィズム
+//#define STL_VECTOR                  // 4. STL の vecotr の例
+//#define MY_NEW                      // 5. new 演算子のメモリ割り当てエラーを検出の例
+//#define FUNCTION_OBJECT             // 6. function object の例
+//#define FUNCTION_POINTER            // 7. 関数ポインタの例
 //#define FUNCTION_POINTER_IN_CLASS   // 8. クラス内で関数ポインタを使う例
-//#define PASS_ARRAY_CONSTRUCTOR  // 9. コンストラクタに渡した Array<> を使う例
-//#define REFERENCE_ARRAY         // 10. 異なる型の Array クラスの参照の代入の例
-//#define GET_PERIPHERAL_ADDRESS  // 11. ピンの名前に対応するペリフェラルのアドレスを取得
-//#define UNION_EXAMPLE           // 12. union の使用例
-//#define INITIALIZE_STRUCT       // 13. 構造体の初期化
-//#define STRUCT_COPY             // 14. 同じ構造で異なる構造体のコピー
-#define COMPOOUND_LITERAL       // 15. 複合リテラルの使用例
+//#define PASS_ARRAY_CONSTRUCTOR      // 9. コンストラクタに渡した Array<> を使う例
+//#define REFERENCE_ARRAY             // 10. 異なる型の Array クラスの参照の代入の例
+//#define GET_PERIPHERAL_ADDRESS      // 11. ピンの名前に対応するペリフェラルのアドレスを取得
+//#define UNION_EXAMPLE               // 12. union の使用例
+//#define INITIALIZE_STRUCT           // 13. 構造体の初期化
+//#define STRUCT_COPY                 // 14. 同じ構造で異なる構造体のコピー
+//#define COMPOOUND_LITERAL           // 15. 複合リテラルの使用例
+#define ARRAY_IN_CLASS              // 16. クラス中の Array クラスのオブジェクトの初期化
 //
 //  有効にすべき define 文はここまで
 //------------------------------------------------------------------------------
@@ -45,10 +48,10 @@
 #include "InitializeStruct.hpp"         // 13. 構造体の初期化
 #include "StructCopy.hpp"               // 14. 同じ構造で異なる構造体のコピー
 #include "CompoundLiteral.hpp"          // 15. 複合リテラルの使用例
-
+#include "ArrayExampleInClass.hpp"      // 16. クラス中の Array クラスのオブジェクトの初期化
 int main()
 {
-    printf("\r\n2017/10/15 12:54\r\n");
+    printf("\r\n2019/04/10 10:11\r\n");
 //------------------------------------------------------------
 // 1 : 算術関数の例
 #ifdef MY_MATH
@@ -138,5 +141,12 @@
 #ifdef COMPOOUND_LITERAL
     CompoundLiteral();
 #endif
+
+//------------------------------------------------------------
+// 16. クラス中の Array クラスのオブジェクトの初期化
+#ifdef ARRAY_IN_CLASS
+    ArrayInClass();
+#endif
+
     while (true) {}
 }