mirror of
https://github.com/nasa/trick.git
synced 2024-12-18 20:57:55 +00:00
Added test case for array templates
This commit is contained in:
parent
67fc66d066
commit
9b320fe3e4
@ -9,8 +9,25 @@ LIBRARY DEPENDENCIES:
|
||||
#include "sim_objects/default_trick_sys.sm"
|
||||
|
||||
##include "test_ip/include/ClassOfEverything.hh"
|
||||
##include "test_ip/include/ArrayTemplate.hh"
|
||||
##include "test_ip/include/OverloadedVariable.hh"
|
||||
|
||||
class ArrayTemplateSimObject : public Trick::SimObject
|
||||
{
|
||||
public:
|
||||
ArrayTemplateSimObject(const ArrayTemplateSimObject&) = delete;
|
||||
ArrayTemplateSimObject& operator=(const ArrayTemplateSimObject&) = delete;
|
||||
|
||||
double a[3];
|
||||
ArrayTemplate<double[3]> arryTemp;
|
||||
|
||||
ArrayTemplateSimObject()
|
||||
: arryTemp(a)
|
||||
{
|
||||
}
|
||||
};
|
||||
ArrayTemplateSimObject arry_temp_object;
|
||||
|
||||
class testSimObject : public Trick::SimObject {
|
||||
|
||||
public:
|
||||
|
37
test/SIM_test_ip/models/test_ip/include/ArrayTemplate.hh
Normal file
37
test/SIM_test_ip/models/test_ip/include/ArrayTemplate.hh
Normal file
@ -0,0 +1,37 @@
|
||||
/**
|
||||
@file
|
||||
|
||||
@verbatim
|
||||
PURPOSE:
|
||||
(Test if we can build with arrays as template parameters)
|
||||
@endverbatim
|
||||
*******************************************************************************/
|
||||
|
||||
#ifndef ARRAY_TEMPLATE_TESTS_HH
|
||||
#define ARRAY_TEMPLATE_TESTS_HH
|
||||
|
||||
// System include files.
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
|
||||
|
||||
template <class SourceType>
|
||||
class ArrayTemplate
|
||||
{
|
||||
public:
|
||||
ArrayTemplate(const SourceType& source)
|
||||
: source(source)
|
||||
{
|
||||
}
|
||||
|
||||
ArrayTemplate(const ArrayTemplate&) = delete;
|
||||
ArrayTemplate& operator=(const ArrayTemplate&) = delete;
|
||||
|
||||
private:
|
||||
const SourceType& source;
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user