Preparing tests for GSI class properties

This commit is contained in:
Matthias Koefferlein
2025-01-16 20:40:42 +01:00
parent 05ba1743d7
commit 063040695a
4 changed files with 33 additions and 0 deletions
+14
View File
@@ -375,6 +375,18 @@ A *A::a20_get ()
return a_inst.get ();
}
static int s_sp = 0;
int A::sp_i_get ()
{
return s_sp;
}
void A::sp_i_set (int v)
{
s_sp = v + 1;
}
// ----------------------------------------------------------------
// Implementation of B
@@ -1253,6 +1265,8 @@ static gsi::Class<A> decl_a ("", "A",
gsi::method ("a9b", &A::a9b) +
gsi::method ("a20", &A::a20) +
gsi::method ("a20_get", &A::a20_get) +
gsi::method ("sp_i", &A::sp_i_get) +
gsi::method ("sp_i=", &A::sp_i_set) +
gsi::method ("to_s", &A::to_s) +
gsi::iterator ("a6", &A::a6b, &A::a6e) +
gsi::iterator ("a7", &A::a7b, &A::a7e) +
+4
View File
@@ -415,6 +415,10 @@ struct A
std::string to_s () const;
// static (class) properties
static int sp_i_get ();
static void sp_i_set (int v);
// members
std::vector<double> m_d;
int n;