Code: Select all
enum Priv {
NONE, USER, ADMIN
}
public final class SystemInfo {
String name, os;
List services = new ArrayList();
List creds = new ArrayList();
Priv priv = Priv.NONE;
List routes = new ArrayList();
SystemInfo(String name, String os, List services,
List creds, Priv priv) {
this.name = name;
this.os = os;
if (services != null)
this.services.addAll(services);
if (creds != null)
this.creds.addAll(creds);
this.priv = priv;
}
}
public final class Route {
SystemInfo to;
List allow = new ArrayList();
Route(SystemInfo to, List allow) {
this.to = to;
if (allow != null)
this.allow.addAll(allow);
}
}
< /code>
Ich versuche, diese in C ++ zu konstruieren: < /p>
#include "ClassB"
class ClassA
{
public:
ClassB obj;
int x;
ClassA(ClassB obj, int x);
};
#include "ClassA.h"
class ClassB
{
public:
ClassA obj;
int x;
ClassB(ClassA obj, int x);
};