Tianchi  v0.0.2 build 20130701
C++ library for Qt with VC & mingW
tctuple.hpp
浏览该文件的文档.
1 // **************************************************************************
2 // Tianchi C++ library for Qt (open source)
3 // 天池共享源码库
4 // 版权所有 (C) 天池共享源码库开发组
5 // 授权协议:请阅读天池共享源码库附带的授权协议
6 // **************************************************************************
7 // 文档说明:简单的 Tuple(元组) 模版类, 提供2~10个类型参数的模版
8 // ==========================================================================
9 // 开发日志:
10 // 日期 人员 说明
11 // --------------------------------------------------------------------------
12 // 2013.05.25 cnhemiya@gmail.com 建立
13 //
14 // ==========================================================================
16 // ==========================================================================
31 
32 #ifndef TIANCHI_TCTUPLE_HPP
33 #define TIANCHI_TCTUPLE_HPP
34 
35 
36 namespace _tc_tuple_ns_
37 {
38 
39 class null_type{ /* none */ };
40 
41 }
42 
43 template<typename T0 = _tc_tuple_ns_::null_type,
44  typename T1 = _tc_tuple_ns_::null_type,
45  typename T2 = _tc_tuple_ns_::null_type,
46  typename T3 = _tc_tuple_ns_::null_type,
47  typename T4 = _tc_tuple_ns_::null_type,
48  typename T5 = _tc_tuple_ns_::null_type,
49  typename T6 = _tc_tuple_ns_::null_type,
50  typename T7 = _tc_tuple_ns_::null_type,
51  typename T8 = _tc_tuple_ns_::null_type,
52  typename T9 = _tc_tuple_ns_::null_type>
53 class TcTuple;
54 
55 template<typename T0, typename T1>
56 class TcTuple<T0, T1,
57  _tc_tuple_ns_::null_type,
65 {
66  typedef TcTuple<T0, T1> this_type;
67 
68 public:
69  TcTuple(){ /* none */ }
70 
71  TcTuple(const T0 &v0, const T1 &v1)
72  {
73  set(v0, v1);
74  }
75 
76  TcTuple(const this_type &ref)
77  {
78  set(ref);
79  }
80 
81  inline const this_type & operator =(const this_type &ref)
82  {
83  set(ref);
84  return *this;
85  }
86 
87  inline bool operator ==(const this_type &ref) const
88  {
89  return ((m_v0 == ref.m_v0) &&
90  (m_v1 == ref.m_v1));
91  }
92 
93  inline bool operator !=(const this_type &ref) const
94  {
95  return !((*this) == ref);
96  }
97 
98  inline void set(const this_type &ref)
99  {
100  set(ref.m_v0, ref.m_v1);
101  }
102 
103  inline void set(const T0 &v0, const T1 &v1)
104  {
105  m_v0 = v0;
106  m_v1 = v1;
107  }
108 
109  inline void set0(const T0 &v0)
110  {
111  m_v0 = v0;
112  }
113 
114  inline T0 & get0()
115  {
116  return m_v0;
117  }
118 
119  inline void set1(const T1 &v1)
120  {
121  m_v1 = v1;
122  }
123 
124  inline T1 & get1()
125  {
126  return m_v1;
127  }
128 
129 private:
130  T0 m_v0;
131  T1 m_v1;
132 };
133 
134 
135 template<typename T0, typename T1, typename T2>
136 class TcTuple<T0, T1, T2,
137  _tc_tuple_ns_::null_type,
144 {
146 
147 public:
148  TcTuple(){ /* none */ }
149 
150  TcTuple(const T0 &v0, const T1 &v1, const T2 &v2)
151  {
152  set(v0, v1, v2);
153  }
154 
155  TcTuple(const this_type &ref)
156  {
157  set(ref);
158  }
159 
160  inline const this_type & operator =(const this_type &ref)
161  {
162  set(ref);
163  return *this;
164  }
165 
166  inline bool operator ==(const this_type &ref) const
167  {
168  return ((m_v0 == ref.m_v0) &&
169  (m_v1 == ref.m_v1) &&
170  (m_v2 == ref.m_v2));
171  }
172 
173  inline bool operator !=(const this_type &ref) const
174  {
175  return !((*this) == ref);
176  }
177 
178  inline void set(const this_type &ref)
179  {
180  set(ref.m_v0, ref.m_v1, ref.m_v2);
181  }
182 
183  inline void set(const T0 &v0, const T1 &v1, const T2 &v2)
184  {
185  m_v0 = v0;
186  m_v1 = v1;
187  m_v2 = v2;
188  }
189 
190  inline void set0(const T0 &v0)
191  {
192  m_v0 = v0;
193  }
194 
195  inline const T0 & get0() const
196  {
197  return m_v0;
198  }
199 
200  inline void set1(const T1 &v1)
201  {
202  m_v1 = v1;
203  }
204 
205  inline const T1 & get1() const
206  {
207  return m_v1;
208  }
209 
210  inline void set2(const T2 &v2)
211  {
212  m_v2 = v2;
213  }
214 
215  inline const T2 & get2() const
216  {
217  return m_v2;
218  }
219 
220 private:
221  T0 m_v0;
222  T1 m_v1;
223  T2 m_v2;
224 };
225 
226 
227 template<typename T0, typename T1, typename T2, typename T3>
228 class TcTuple<T0, T1, T2, T3,
229  _tc_tuple_ns_::null_type,
235 {
237 
238 public:
239  TcTuple(){ /* none */ }
240 
241  TcTuple(const T0 &v0, const T1 &v1, const T2 &v2, const T3 &v3)
242  {
243  set(v0, v1, v2, v3);
244  }
245 
246  TcTuple(const this_type &ref)
247  {
248  set(ref);
249  }
250 
251  inline const this_type & operator =(const this_type &ref)
252  {
253  set(ref);
254  return *this;
255  }
256 
257  inline bool operator ==(const this_type &ref) const
258  {
259  return ((m_v0 == ref.m_v0) &&
260  (m_v1 == ref.m_v1) &&
261  (m_v2 == ref.m_v2) &&
262  (m_v3 == ref.m_v3));
263  }
264 
265  inline bool operator !=(const this_type &ref) const
266  {
267  return !((*this) == ref);
268  }
269 
270  inline void set(const this_type &ref)
271  {
272  set(ref.m_v0, ref.m_v1, ref.m_v2, ref.m_v3);
273  }
274 
275  inline void set(const T0 &v0, const T1 &v1, const T2 &v2, const T3 &v3)
276  {
277  m_v0 = v0;
278  m_v1 = v1;
279  m_v2 = v2;
280  m_v3 = v3;
281  }
282 
283  inline void set0(const T0 &v0)
284  {
285  m_v0 = v0;
286  }
287 
288  inline const T0 & get0() const
289  {
290  return m_v0;
291  }
292 
293  inline void set1(const T1 &v1)
294  {
295  m_v1 = v1;
296  }
297 
298  inline const T1 & get1() const
299  {
300  return m_v1;
301  }
302 
303  inline void set2(const T2 &v2)
304  {
305  m_v2 = v2;
306  }
307 
308  inline const T2 & get2() const
309  {
310  return m_v2;
311  }
312 
313  inline void set3(const T3 &v3)
314  {
315  m_v3 = v3;
316  }
317 
318  inline const T3 & get3() const
319  {
320  return m_v3;
321  }
322 
323 private:
324  T0 m_v0;
325  T1 m_v1;
326  T2 m_v2;
327  T3 m_v3;
328 };
329 
330 
331 template<typename T0, typename T1, typename T2, typename T3,
332  typename T4>
333 class TcTuple<T0, T1, T2, T3, T4,
334  _tc_tuple_ns_::null_type,
339 {
341 
342 public:
343  TcTuple(){ /* none */ }
344 
345  TcTuple(const T0 &v0, const T1 &v1, const T2 &v2, const T3 &v3, const T4 &v4)
346  {
347  set(v0, v1, v2, v3, v4);
348  }
349 
350  TcTuple(const this_type &ref)
351  {
352  set(ref);
353  }
354 
355  inline const this_type & operator =(const this_type &ref)
356  {
357  set(ref);
358  return *this;
359  }
360 
361  inline bool operator ==(const this_type &ref) const
362  {
363  return ((m_v0 == ref.m_v0) &&
364  (m_v1 == ref.m_v1) &&
365  (m_v2 == ref.m_v2) &&
366  (m_v3 == ref.m_v3) &&
367  (m_v4 == ref.m_v4));
368  }
369 
370  inline bool operator !=(const this_type &ref) const
371  {
372  return !((*this) == ref);
373  }
374 
375  inline void set(const this_type &ref)
376  {
377  set(ref.m_v0, ref.m_v1, ref.m_v2, ref.m_v3, ref.m_v4);
378  }
379 
380  inline void set(const T0 &v0, const T1 &v1, const T2 &v2, const T3 &v3,
381  const T4 &v4)
382  {
383  m_v0 = v0;
384  m_v1 = v1;
385  m_v2 = v2;
386  m_v3 = v3;
387  m_v4 = v4;
388  }
389 
390  inline void set0(const T0 &v0)
391  {
392  m_v0 = v0;
393  }
394 
395  inline const T0 & get0() const
396  {
397  return m_v0;
398  }
399 
400  inline void set1(const T1 &v1)
401  {
402  m_v1 = v1;
403  }
404 
405  inline const T1 & get1() const
406  {
407  return m_v1;
408  }
409 
410  inline void set2(const T2 &v2)
411  {
412  m_v2 = v2;
413  }
414 
415  inline const T2 & get2() const
416  {
417  return m_v2;
418  }
419 
420  inline void set3(const T3 &v3)
421  {
422  m_v3 = v3;
423  }
424 
425  inline const T3 & get3() const
426  {
427  return m_v3;
428  }
429 
430  inline void set4(const T4 &v4)
431  {
432  m_v4 = v4;
433  }
434 
435  inline const T4 & get4() const
436  {
437  return m_v4;
438  }
439 
440 private:
441  T0 m_v0;
442  T1 m_v1;
443  T2 m_v2;
444  T3 m_v3;
445  T4 m_v4;
446 };
447 
448 
449 template<typename T0, typename T1, typename T2, typename T3,
450  typename T4, typename T5>
451 class TcTuple<T0, T1, T2, T3, T4, T5,
452  _tc_tuple_ns_::null_type,
456 {
458 
459 public:
460  TcTuple(){ /* none */ }
461 
462  TcTuple(const T0 &v0, const T1 &v1, const T2 &v2, const T3 &v3, const T4 &v4,
463  const T5 &v5)
464  {
465  set(v0, v1, v2, v3, v4, v5);
466  }
467 
468  TcTuple(const this_type &ref)
469  {
470  set(ref);
471  }
472 
473  inline const this_type & operator =(const this_type &ref)
474  {
475  set(ref);
476  return *this;
477  }
478 
479  inline bool operator ==(const this_type &ref) const
480  {
481  return ((m_v0 == ref.m_v0) &&
482  (m_v1 == ref.m_v1) &&
483  (m_v2 == ref.m_v2) &&
484  (m_v3 == ref.m_v3) &&
485  (m_v4 == ref.m_v4) &&
486  (m_v5 == ref.m_v5));
487  }
488 
489  inline bool operator !=(const this_type &ref) const
490  {
491  return !((*this) == ref);
492  }
493 
494  inline void set(const this_type &ref)
495  {
496  set(ref.m_v0, ref.m_v1, ref.m_v2, ref.m_v3, ref.m_v4, ref.m_v5);
497  }
498 
499  inline void set(const T0 &v0, const T1 &v1, const T2 &v2, const T3 &v3,
500  const T4 &v4, const T5 &v5)
501  {
502  m_v0 = v0;
503  m_v1 = v1;
504  m_v2 = v2;
505  m_v3 = v3;
506  m_v4 = v4;
507  m_v5 = v5;
508  }
509 
510  inline void set0(const T0 &v0)
511  {
512  m_v0 = v0;
513  }
514 
515  inline const T0 & get0() const
516  {
517  return m_v0;
518  }
519 
520  inline void set1(const T1 &v1)
521  {
522  m_v1 = v1;
523  }
524 
525  inline const T1 & get1() const
526  {
527  return m_v1;
528  }
529 
530  inline void set2(const T2 &v2)
531  {
532  m_v2 = v2;
533  }
534 
535  inline const T2 & get2() const
536  {
537  return m_v2;
538  }
539 
540  inline void set3(const T3 &v3)
541  {
542  m_v3 = v3;
543  }
544 
545  inline const T3 & get3() const
546  {
547  return m_v3;
548  }
549 
550  inline void set4(const T4 &v4)
551  {
552  m_v4 = v4;
553  }
554 
555  inline const T4 & get4() const
556  {
557  return m_v4;
558  }
559 
560  inline void set5(const T5 &v5)
561  {
562  m_v5 = v5;
563  }
564 
565  inline const T5 & get5() const
566  {
567  return m_v5;
568  }
569 
570 private:
571  T0 m_v0;
572  T1 m_v1;
573  T2 m_v2;
574  T3 m_v3;
575  T4 m_v4;
576  T5 m_v5;
577 };
578 
579 
580 template<typename T0, typename T1, typename T2, typename T3,
581  typename T4, typename T5, typename T6>
582 class TcTuple<T0, T1, T2, T3, T4, T5, T6,
583  _tc_tuple_ns_::null_type,
586 {
588 
589 public:
590  TcTuple(){ /* none */ }
591 
592  TcTuple(const T0 &v0, const T1 &v1, const T2 &v2, const T3 &v3, const T4 &v4,
593  const T5 &v5, const T6 &v6)
594  {
595  set(v0, v1, v2, v3, v4, v5, v6);
596  }
597 
598  TcTuple(const this_type &ref)
599  {
600  set(ref);
601  }
602 
603  inline const this_type & operator =(const this_type &ref)
604  {
605  set(ref);
606  return *this;
607  }
608 
609  inline bool operator ==(const this_type &ref) const
610  {
611  return ((m_v0 == ref.m_v0) &&
612  (m_v1 == ref.m_v1) &&
613  (m_v2 == ref.m_v2) &&
614  (m_v3 == ref.m_v3) &&
615  (m_v4 == ref.m_v4) &&
616  (m_v5 == ref.m_v5) &&
617  (m_v6 == ref.m_v6));
618  }
619 
620  inline bool operator !=(const this_type &ref) const
621  {
622  return !((*this) == ref);
623  }
624 
625  inline void set(const this_type &ref)
626  {
627  set(ref.m_v0, ref.m_v1, ref.m_v2, ref.m_v3, ref.m_v4,
628  ref.m_v5, ref.m_v6);
629  }
630 
631  inline void set(const T0 &v0, const T1 &v1, const T2 &v2, const T3 &v3,
632  const T4 &v4, const T5 &v5, const T6 &v6)
633  {
634  m_v0 = v0;
635  m_v1 = v1;
636  m_v2 = v2;
637  m_v3 = v3;
638  m_v4 = v4;
639  m_v5 = v5;
640  m_v6 = v6;
641  }
642 
643  inline void set0(const T0 &v0)
644  {
645  m_v0 = v0;
646  }
647 
648  inline const T0 & get0() const
649  {
650  return m_v0;
651  }
652 
653  inline void set1(const T1 &v1)
654  {
655  m_v1 = v1;
656  }
657 
658  inline const T1 & get1() const
659  {
660  return m_v1;
661  }
662 
663  inline void set2(const T2 &v2)
664  {
665  m_v2 = v2;
666  }
667 
668  inline const T2 & get2() const
669  {
670  return m_v2;
671  }
672 
673  inline void set3(const T3 &v3)
674  {
675  m_v3 = v3;
676  }
677 
678  inline const T3 & get3() const
679  {
680  return m_v3;
681  }
682 
683  inline void set4(const T4 &v4)
684  {
685  m_v4 = v4;
686  }
687 
688  inline const T4 & get4() const
689  {
690  return m_v4;
691  }
692 
693  inline void set5(const T5 &v5)
694  {
695  m_v5 = v5;
696  }
697 
698  inline const T5 & get5() const
699  {
700  return m_v5;
701  }
702 
703  inline void set6(const T6 &v6)
704  {
705  m_v6 = v6;
706  }
707 
708  inline const T6 & get6() const
709  {
710  return m_v6;
711  }
712 
713 private:
714  T0 m_v0;
715  T1 m_v1;
716  T2 m_v2;
717  T3 m_v3;
718  T4 m_v4;
719  T5 m_v5;
720  T6 m_v6;
721 };
722 
723 
724 template<typename T0, typename T1, typename T2, typename T3,
725  typename T4, typename T5, typename T6, typename T7>
726 class TcTuple<T0, T1, T2, T3, T4, T5, T6, T7,
727  _tc_tuple_ns_::null_type,
729 {
731 
732 public:
733  TcTuple(){ /* none */ }
734 
735  TcTuple(const T0 &v0, const T1 &v1, const T2 &v2, const T3 &v3, const T4 &v4,
736  const T5 &v5, const T6 &v6, const T7 &v7)
737  {
738  set(v0, v1, v2, v3, v4, v5, v6, v7);
739  }
740 
741  TcTuple(const this_type &ref)
742  {
743  set(ref);
744  }
745 
746  inline const this_type & operator =(const this_type &ref)
747  {
748  set(ref);
749  return *this;
750  }
751 
752  inline bool operator ==(const this_type &ref) const
753  {
754  return ((m_v0 == ref.m_v0) &&
755  (m_v1 == ref.m_v1) &&
756  (m_v2 == ref.m_v2) &&
757  (m_v3 == ref.m_v3) &&
758  (m_v4 == ref.m_v4) &&
759  (m_v5 == ref.m_v5) &&
760  (m_v6 == ref.m_v6) &&
761  (m_v7 == ref.m_v7));
762  }
763 
764  inline bool operator !=(const this_type &ref) const
765  {
766  return !((*this) == ref);
767  }
768 
769  inline void set(const this_type &ref)
770  {
771  set(ref.m_v0, ref.m_v1, ref.m_v2, ref.m_v3, ref.m_v4,
772  ref.m_v5, ref.m_v6, ref.m_v7);
773  }
774 
775  inline void set(const T0 &v0, const T1 &v1, const T2 &v2, const T3 &v3,
776  const T4 &v4, const T5 &v5, const T6 &v6, const T7 &v7)
777  {
778  m_v0 = v0;
779  m_v1 = v1;
780  m_v2 = v2;
781  m_v3 = v3;
782  m_v4 = v4;
783  m_v5 = v5;
784  m_v6 = v6;
785  m_v7 = v7;
786  }
787 
788  inline void set0(const T0 &v0)
789  {
790  m_v0 = v0;
791  }
792 
793  inline const T0 & get0() const
794  {
795  return m_v0;
796  }
797 
798  inline void set1(const T1 &v1)
799  {
800  m_v1 = v1;
801  }
802 
803  inline const T1 & get1() const
804  {
805  return m_v1;
806  }
807 
808  inline void set2(const T2 &v2)
809  {
810  m_v2 = v2;
811  }
812 
813  inline const T2 & get2() const
814  {
815  return m_v2;
816  }
817 
818  inline void set3(const T3 &v3)
819  {
820  m_v3 = v3;
821  }
822 
823  inline const T3 & get3() const
824  {
825  return m_v3;
826  }
827 
828  inline void set4(const T4 &v4)
829  {
830  m_v4 = v4;
831  }
832 
833  inline const T4 & get4() const
834  {
835  return m_v4;
836  }
837 
838  inline void set5(const T5 &v5)
839  {
840  m_v5 = v5;
841  }
842 
843  inline const T5 & get5() const
844  {
845  return m_v5;
846  }
847 
848  inline void set6(const T6 &v6)
849  {
850  m_v6 = v6;
851  }
852 
853  inline const T6 & get6() const
854  {
855  return m_v6;
856  }
857 
858  inline void set7(const T7 &v7)
859  {
860  m_v7 = v7;
861  }
862 
863  inline const T7 & get7() const
864  {
865  return m_v7;
866  }
867 
868 private:
869  T0 m_v0;
870  T1 m_v1;
871  T2 m_v2;
872  T3 m_v3;
873  T4 m_v4;
874  T5 m_v5;
875  T6 m_v6;
876  T7 m_v7;
877 };
878 
879 
880 template<typename T0, typename T1, typename T2, typename T3,
881  typename T4, typename T5, typename T6, typename T7,
882  typename T8>
883 class TcTuple<T0, T1, T2, T3, T4, T5, T6, T7, T8,
884  _tc_tuple_ns_::null_type>
885 {
887 
888 public:
889  TcTuple(){ /* none */ }
890 
891  TcTuple(const T0 &v0, const T1 &v1, const T2 &v2, const T3 &v3, const T4 &v4,
892  const T5 &v5, const T6 &v6, const T7 &v7, const T8 &v8)
893  {
894  set(v0, v1, v2, v3, v4, v5, v6, v7, v8);
895  }
896 
897  TcTuple(const this_type &ref)
898  {
899  set(ref);
900  }
901 
902  inline const this_type & operator =(const this_type &ref)
903  {
904  set(ref);
905  return *this;
906  }
907 
908  inline bool operator ==(const this_type &ref) const
909  {
910  return ((m_v0 == ref.m_v0) &&
911  (m_v1 == ref.m_v1) &&
912  (m_v2 == ref.m_v2) &&
913  (m_v3 == ref.m_v3) &&
914  (m_v4 == ref.m_v4) &&
915  (m_v5 == ref.m_v5) &&
916  (m_v6 == ref.m_v6) &&
917  (m_v7 == ref.m_v7) &&
918  (m_v8 == ref.m_v8));
919  }
920 
921  inline bool operator !=(const this_type &ref) const
922  {
923  return !((*this) == ref);
924  }
925 
926  inline void set(const this_type &ref)
927  {
928  set(ref.m_v0, ref.m_v1, ref.m_v2, ref.m_v3, ref.m_v4,
929  ref.m_v5, ref.m_v6, ref.m_v7, ref.m_v8);
930  }
931 
932  inline void set(const T0 &v0, const T1 &v1, const T2 &v2, const T3 &v3,
933  const T4 &v4, const T5 &v5, const T6 &v6, const T7 &v7,
934  const T8 &v8)
935  {
936  m_v0 = v0;
937  m_v1 = v1;
938  m_v2 = v2;
939  m_v3 = v3;
940  m_v4 = v4;
941  m_v5 = v5;
942  m_v6 = v6;
943  m_v7 = v7;
944  m_v8 = v8;
945  }
946 
947  inline void set0(const T0 &v0)
948  {
949  m_v0 = v0;
950  }
951 
952  inline const T0 & get0() const
953  {
954  return m_v0;
955  }
956 
957  inline void set1(const T1 &v1)
958  {
959  m_v1 = v1;
960  }
961 
962  inline const T1 & get1() const
963  {
964  return m_v1;
965  }
966 
967  inline void set2(const T2 &v2)
968  {
969  m_v2 = v2;
970  }
971 
972  inline const T2 & get2() const
973  {
974  return m_v2;
975  }
976 
977  inline void set3(const T3 &v3)
978  {
979  m_v3 = v3;
980  }
981 
982  inline const T3 & get3() const
983  {
984  return m_v3;
985  }
986 
987  inline void set4(const T4 &v4)
988  {
989  m_v4 = v4;
990  }
991 
992  inline const T4 & get4() const
993  {
994  return m_v4;
995  }
996 
997  inline void set5(const T5 &v5)
998  {
999  m_v5 = v5;
1000  }
1001 
1002  inline const T5 & get5() const
1003  {
1004  return m_v5;
1005  }
1006 
1007  inline void set6(const T6 &v6)
1008  {
1009  m_v6 = v6;
1010  }
1011 
1012  inline const T6 & get6() const
1013  {
1014  return m_v6;
1015  }
1016 
1017  inline void set7(const T7 &v7)
1018  {
1019  m_v7 = v7;
1020  }
1021 
1022  inline const T7 & get7() const
1023  {
1024  return m_v7;
1025  }
1026 
1027  inline void set8(const T8 &v8)
1028  {
1029  m_v8 = v8;
1030  }
1031 
1032  inline const T8 & get8() const
1033  {
1034  return m_v8;
1035  }
1036 
1037 private:
1038  T0 m_v0;
1039  T1 m_v1;
1040  T2 m_v2;
1041  T3 m_v3;
1042  T4 m_v4;
1043  T5 m_v5;
1044  T6 m_v6;
1045  T7 m_v7;
1046  T8 m_v8;
1047 };
1048 
1049 template<typename T0, typename T1, typename T2, typename T3,
1050  typename T4, typename T5, typename T6, typename T7,
1051  typename T8, typename T9>
1052 class TcTuple
1053 {
1055 
1056 public:
1057  TcTuple(){ /* none */ }
1058 
1059  TcTuple(const T0 &v0, const T1 &v1, const T2 &v2, const T3 &v3, const T4 &v4,
1060  const T5 &v5, const T6 &v6, const T7 &v7, const T8 &v8, const T9 &v9)
1061  {
1062  set(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9);
1063  }
1064 
1065  TcTuple(const this_type &ref)
1066  {
1067  set(ref);
1068  }
1069 
1070  inline const this_type & operator =(const this_type &ref)
1071  {
1072  set(ref);
1073  return *this;
1074  }
1075 
1076  inline bool operator ==(const this_type &ref) const
1077  {
1078  return ((m_v0 == ref.m_v0) &&
1079  (m_v1 == ref.m_v1) &&
1080  (m_v2 == ref.m_v2) &&
1081  (m_v3 == ref.m_v3) &&
1082  (m_v4 == ref.m_v4) &&
1083  (m_v5 == ref.m_v5) &&
1084  (m_v6 == ref.m_v6) &&
1085  (m_v7 == ref.m_v7) &&
1086  (m_v8 == ref.m_v8) &&
1087  (m_v9 == ref.m_v9));
1088  }
1089 
1090  inline bool operator !=(const this_type &ref) const
1091  {
1092  return !((*this) == ref);
1093  }
1094 
1095  inline void set(const this_type &ref)
1096  {
1097  set(ref.m_v0, ref.m_v1, ref.m_v2, ref.m_v3, ref.m_v4,
1098  ref.m_v5, ref.m_v6, ref.m_v7, ref.m_v8, ref.m_v9);
1099  }
1100 
1101  inline void set(const T0 &v0, const T1 &v1, const T2 &v2, const T3 &v3,
1102  const T4 &v4, const T5 &v5, const T6 &v6, const T7 &v7,
1103  const T8 &v8, const T9 &v9)
1104  {
1105  m_v0 = v0;
1106  m_v1 = v1;
1107  m_v2 = v2;
1108  m_v3 = v3;
1109  m_v4 = v4;
1110  m_v5 = v5;
1111  m_v6 = v6;
1112  m_v7 = v7;
1113  m_v8 = v8;
1114  m_v9 = v9;
1115  }
1116 
1117  inline void set0(const T0 &v0)
1118  {
1119  m_v0 = v0;
1120  }
1121 
1122  inline const T0 & get0() const
1123  {
1124  return m_v0;
1125  }
1126 
1127  inline void set1(const T1 &v1)
1128  {
1129  m_v1 = v1;
1130  }
1131 
1132  inline const T1 & get1() const
1133  {
1134  return m_v1;
1135  }
1136 
1137  inline void set2(const T2 &v2)
1138  {
1139  m_v2 = v2;
1140  }
1141 
1142  inline const T2 & get2() const
1143  {
1144  return m_v2;
1145  }
1146 
1147  inline void set3(const T3 &v3)
1148  {
1149  m_v3 = v3;
1150  }
1151 
1152  inline const T3 & get3() const
1153  {
1154  return m_v3;
1155  }
1156 
1157  inline void set4(const T4 &v4)
1158  {
1159  m_v4 = v4;
1160  }
1161 
1162  inline const T4 & get4() const
1163  {
1164  return m_v4;
1165  }
1166 
1167  inline void set5(const T5 &v5)
1168  {
1169  m_v5 = v5;
1170  }
1171 
1172  inline const T5 & get5() const
1173  {
1174  return m_v5;
1175  }
1176 
1177  inline void set6(const T6 &v6)
1178  {
1179  m_v6 = v6;
1180  }
1181 
1182  inline const T6 & get6() const
1183  {
1184  return m_v6;
1185  }
1186 
1187  inline void set7(const T7 &v7)
1188  {
1189  m_v7 = v7;
1190  }
1191 
1192  inline const T7 & get7() const
1193  {
1194  return m_v7;
1195  }
1196 
1197  inline void set8(const T8 &v8)
1198  {
1199  m_v8 = v8;
1200  }
1201 
1202  inline const T8 & get8() const
1203  {
1204  return m_v8;
1205  }
1206 
1207  inline void set9(const T9 &v9)
1208  {
1209  m_v9 = v9;
1210  }
1211 
1212  inline const T9 & get9() const
1213  {
1214  return m_v9;
1215  }
1216 
1217 private:
1218  T0 m_v0;
1219  T1 m_v1;
1220  T2 m_v2;
1221  T3 m_v3;
1222  T4 m_v4;
1223  T5 m_v5;
1224  T6 m_v6;
1225  T7 m_v7;
1226  T8 m_v8;
1227  T9 m_v9;
1228 };
1229 
1230 
1231 #endif // TIANCHI_TCTUPLE_HPP