Skip to content

Commit 049d71c

Browse files
committed
xrAICore: fix some compilation error on Linux
1 parent 9f011fd commit 049d71c

15 files changed

+110
-105
lines changed

src/xrAICore/CMakeLists.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,11 @@ include_directories(
1616
${CMAKE_CURRENT_SOURCE_DIR}/../../sdk/include
1717
)
1818

19-
#list(REMOVE_ITEM ${PROJECT_NAME}__SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/./xr_cda.cpp")
20-
#list(REMOVE_ITEM ${PROJECT_NAME}__INCLUDES "${CMAKE_CURRENT_SOURCE_DIR}/./xr_cda.h")
19+
#foreach(header ${${PROJECT_NAME}__INCLUDES})
20+
# if (${header} MATCHES _inline.h$)
21+
# list(REMOVE_ITEM ${PROJECT_NAME}__INCLUDES ${header})
22+
# endif()
23+
#endforeach()
2124

2225
add_definitions(-DXRAICORE_EXPORTS -DAI_COMPILER -D_SECURE_SCL=0)
2326
add_library(${PROJECT_NAME} SHARED ${${PROJECT_NAME}__SOURCES} ${${PROJECT_NAME}__INCLUDES})

src/xrAICore/Components/condition_state_inline.h

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ IC void CConditionStateAbstract::add_condition_back(const COperatorCondition& co
3838
TEMPLATE_SPECIALIZATION
3939
IC void CConditionStateAbstract::add_condition(const COperatorCondition& condition)
4040
{
41-
xr_vector<COperatorCondition>::iterator I = std::lower_bound(m_conditions.begin(), m_conditions.end(), condition);
41+
typename xr_vector<COperatorCondition>::iterator I = std::lower_bound(m_conditions.begin(), m_conditions.end(), condition);
4242
THROW((I == m_conditions.end()) || ((*I).condition() != condition.condition()));
4343
m_conditions.insert(I, condition);
4444
m_hash ^= condition.hash_value();
@@ -47,7 +47,7 @@ IC void CConditionStateAbstract::add_condition(const COperatorCondition& conditi
4747
TEMPLATE_SPECIALIZATION
4848
IC void CConditionStateAbstract::remove_condition(const typename COperatorCondition::_condition_type& condition)
4949
{
50-
xr_vector<COperatorCondition>::iterator I = std::lower_bound(
50+
typename xr_vector<COperatorCondition>::iterator I = std::lower_bound(
5151
m_conditions.begin(), m_conditions.end(), COperatorCondition(condition, COperatorCondition::_value_type(0)));
5252
THROW((I != m_conditions.end()) && ((*I).condition() == condition));
5353
m_hash ^= (*I).hash_value();
@@ -73,10 +73,10 @@ TEMPLATE_SPECIALIZATION
7373
IC u8 CConditionStateAbstract::weight(const CConditionState& condition) const
7474
{
7575
u8 result = 0;
76-
xr_vector<COperatorCondition>::const_iterator I = conditions().begin();
77-
xr_vector<COperatorCondition>::const_iterator E = conditions().end();
78-
xr_vector<COperatorCondition>::const_iterator i = condition.conditions().begin();
79-
xr_vector<COperatorCondition>::const_iterator e = condition.conditions().end();
76+
typename xr_vector<COperatorCondition>::const_iterator I = conditions().begin();
77+
typename xr_vector<COperatorCondition>::const_iterator E = conditions().end();
78+
typename xr_vector<COperatorCondition>::const_iterator i = condition.conditions().begin();
79+
typename xr_vector<COperatorCondition>::const_iterator e = condition.conditions().end();
8080
for (; (I != E) && (i != e);)
8181
if ((*I).condition() < (*i).condition())
8282
++I;
@@ -95,10 +95,10 @@ IC u8 CConditionStateAbstract::weight(const CConditionState& condition) const
9595
TEMPLATE_SPECIALIZATION
9696
IC bool CConditionStateAbstract::operator<(const CConditionState& condition) const
9797
{
98-
xr_vector<COperatorCondition>::const_iterator I = conditions().begin();
99-
xr_vector<COperatorCondition>::const_iterator E = conditions().end();
100-
xr_vector<COperatorCondition>::const_iterator i = condition.conditions().begin();
101-
xr_vector<COperatorCondition>::const_iterator e = condition.conditions().end();
98+
typename xr_vector<COperatorCondition>::const_iterator I = conditions().begin();
99+
typename xr_vector<COperatorCondition>::const_iterator E = conditions().end();
100+
typename xr_vector<COperatorCondition>::const_iterator i = condition.conditions().begin();
101+
typename xr_vector<COperatorCondition>::const_iterator e = condition.conditions().end();
102102
for (; (I != E) && (i != e); ++I, ++i)
103103
if (*I < *i)
104104
return (true);
@@ -118,10 +118,10 @@ IC bool CConditionStateAbstract::operator==(const CConditionState& condition) co
118118
{
119119
if (hash_value() != condition.hash_value())
120120
return (false);
121-
xr_vector<COperatorCondition>::const_iterator I = conditions().begin();
122-
xr_vector<COperatorCondition>::const_iterator E = conditions().end();
123-
xr_vector<COperatorCondition>::const_iterator i = condition.conditions().begin();
124-
xr_vector<COperatorCondition>::const_iterator e = condition.conditions().end();
121+
typename xr_vector<COperatorCondition>::const_iterator I = conditions().begin();
122+
typename xr_vector<COperatorCondition>::const_iterator E = conditions().end();
123+
typename xr_vector<COperatorCondition>::const_iterator i = condition.conditions().begin();
124+
typename xr_vector<COperatorCondition>::const_iterator e = condition.conditions().end();
125125
for (; (I != E) && (i != e); ++I, ++i)
126126
if (!(*I == *i))
127127
return (false);
@@ -134,11 +134,11 @@ TEMPLATE_SPECIALIZATION
134134
IC CConditionState<_world_property>& CConditionStateAbstract::operator-=(const CConditionState& condition)
135135
{
136136
m_hash = 0;
137-
xr_vector<COperatorCondition> temp;
138-
xr_vector<COperatorCondition>::const_iterator I = conditions().begin();
139-
xr_vector<COperatorCondition>::const_iterator E = conditions().end();
140-
xr_vector<COperatorCondition>::const_iterator i = condition.conditions().begin();
141-
xr_vector<COperatorCondition>::const_iterator e = condition.conditions().end();
137+
xr_vector<COperatorCondition> temp;
138+
typename xr_vector<COperatorCondition>::const_iterator I = conditions().begin();
139+
typename xr_vector<COperatorCondition>::const_iterator E = conditions().end();
140+
typename xr_vector<COperatorCondition>::const_iterator i = condition.conditions().begin();
141+
typename xr_vector<COperatorCondition>::const_iterator e = condition.conditions().end();
142142
for (; (I != E) && (i != e);)
143143
if ((*I).condition() < (*i).condition())
144144
++I;
@@ -161,10 +161,10 @@ IC CConditionState<_world_property>& CConditionStateAbstract::operator-=(const C
161161
TEMPLATE_SPECIALIZATION
162162
IC bool CConditionStateAbstract::includes(const CConditionState& condition) const
163163
{
164-
xr_vector<COperatorCondition>::const_iterator I = conditions().begin();
165-
xr_vector<COperatorCondition>::const_iterator E = conditions().end();
166-
xr_vector<COperatorCondition>::const_iterator i = condition.conditions().begin();
167-
xr_vector<COperatorCondition>::const_iterator e = condition.conditions().end();
164+
typename xr_vector<COperatorCondition>::const_iterator I = conditions().begin();
165+
typename xr_vector<COperatorCondition>::const_iterator E = conditions().end();
166+
typename xr_vector<COperatorCondition>::const_iterator i = condition.conditions().begin();
167+
typename xr_vector<COperatorCondition>::const_iterator e = condition.conditions().end();
168168
for (; (I != E) && (i != e);)
169169
if ((*I).condition() < (*i).condition())
170170
++I;
@@ -186,7 +186,7 @@ TEMPLATE_SPECIALIZATION
186186
IC const typename CConditionStateAbstract::COperatorCondition* CConditionStateAbstract::property(
187187
const typename CConditionStateAbstract::COperatorCondition::_condition_type& condition) const
188188
{
189-
xr_vector<COperatorCondition>::const_iterator I = std::lower_bound(
189+
typename xr_vector<COperatorCondition>::const_iterator I = std::lower_bound(
190190
conditions().begin(), conditions().end(), COperatorCondition(condition, COperatorCondition::_value_type(0)));
191191
if (I == m_conditions.end())
192192
return (0);

src/xrAICore/Components/operator_abstract_inline.h

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,12 @@ TEMPLATE_SPECIALIZATION
8989
IC bool CAbstractOperator::applicable_reverse(
9090
const CSConditionState& condition, const CSConditionState& start, const CSConditionState& self_condition) const
9191
{
92-
xr_vector<COperatorCondition>::const_iterator i = self_condition.conditions().begin();
93-
xr_vector<COperatorCondition>::const_iterator e = self_condition.conditions().end();
94-
xr_vector<COperatorCondition>::const_iterator I = condition.conditions().begin();
95-
xr_vector<COperatorCondition>::const_iterator E = condition.conditions().end();
96-
xr_vector<COperatorCondition>::const_iterator J = start.conditions().begin();
97-
xr_vector<COperatorCondition>::const_iterator EE = start.conditions().end();
92+
typename xr_vector<COperatorCondition>::const_iterator i = self_condition.conditions().begin();
93+
typename xr_vector<COperatorCondition>::const_iterator e = self_condition.conditions().end();
94+
typename xr_vector<COperatorCondition>::const_iterator I = condition.conditions().begin();
95+
typename xr_vector<COperatorCondition>::const_iterator E = condition.conditions().end();
96+
typename xr_vector<COperatorCondition>::const_iterator J = start.conditions().begin();
97+
typename xr_vector<COperatorCondition>::const_iterator EE = start.conditions().end();
9898
for (; (I != E) && (i != e);)
9999
if ((*I).condition() < (*i).condition())
100100
++I;
@@ -142,12 +142,12 @@ IC bool CAbstractOperator::apply_reverse(const CSConditionState& condition, cons
142142
{
143143
result.clear();
144144
bool changed = false;
145-
xr_vector<COperatorCondition>::const_iterator i = self_condition.conditions().begin();
146-
xr_vector<COperatorCondition>::const_iterator e = self_condition.conditions().end();
147-
xr_vector<COperatorCondition>::const_iterator I = condition.conditions().begin();
148-
xr_vector<COperatorCondition>::const_iterator E = condition.conditions().end();
149-
xr_vector<COperatorCondition>::const_iterator J = start.conditions().begin();
150-
xr_vector<COperatorCondition>::const_iterator EE = start.conditions().end();
145+
typename xr_vector<COperatorCondition>::const_iterator i = self_condition.conditions().begin();
146+
typename xr_vector<COperatorCondition>::const_iterator e = self_condition.conditions().end();
147+
typename xr_vector<COperatorCondition>::const_iterator I = condition.conditions().begin();
148+
typename xr_vector<COperatorCondition>::const_iterator E = condition.conditions().end();
149+
typename xr_vector<COperatorCondition>::const_iterator J = start.conditions().begin();
150+
typename xr_vector<COperatorCondition>::const_iterator EE = start.conditions().end();
151151
for (; (I != E) && (i != e);)
152152
if ((*I).condition() < (*i).condition())
153153
{
@@ -217,12 +217,12 @@ template <typename T>
217217
IC bool CAbstractOperator::applicable(const CSConditionState& current, const CSConditionState& start,
218218
const CSConditionState& conditions, T& problem_solver) const
219219
{
220-
xr_vector<COperatorCondition>::const_iterator I = current.conditions().begin();
221-
xr_vector<COperatorCondition>::const_iterator E = current.conditions().end();
222-
xr_vector<COperatorCondition>::const_iterator i = conditions.conditions().begin();
223-
xr_vector<COperatorCondition>::const_iterator e = conditions.conditions().end();
224-
xr_vector<COperatorCondition>::const_iterator II = start.conditions().begin();
225-
xr_vector<COperatorCondition>::const_iterator EE = start.conditions().end();
220+
typename xr_vector<COperatorCondition>::const_iterator I = current.conditions().begin();
221+
typename xr_vector<COperatorCondition>::const_iterator E = current.conditions().end();
222+
typename xr_vector<COperatorCondition>::const_iterator i = conditions.conditions().begin();
223+
typename xr_vector<COperatorCondition>::const_iterator e = conditions.conditions().end();
224+
typename xr_vector<COperatorCondition>::const_iterator II = start.conditions().begin();
225+
typename xr_vector<COperatorCondition>::const_iterator EE = start.conditions().end();
226226
for (; (I != E) && (i != e);)
227227
{
228228
if ((*I).condition() < (*i).condition())
@@ -281,12 +281,12 @@ IC const typename CAbstractOperator::CSConditionState& CAbstractOperator::apply(
281281
const CSConditionState& effects, CSConditionState& result, CSConditionState& start, T& problem_solver) const
282282
{
283283
result.clear();
284-
xr_vector<COperatorCondition>::const_iterator I = current.conditions().begin();
285-
xr_vector<COperatorCondition>::const_iterator E = current.conditions().end();
286-
xr_vector<COperatorCondition>::const_iterator i = effects.conditions().begin();
287-
xr_vector<COperatorCondition>::const_iterator e = effects.conditions().end();
288-
xr_vector<COperatorCondition>::const_iterator II = start.conditions().begin();
289-
xr_vector<COperatorCondition>::const_iterator EE = start.conditions().end();
284+
typename xr_vector<COperatorCondition>::const_iterator I = current.conditions().begin();
285+
typename xr_vector<COperatorCondition>::const_iterator E = current.conditions().end();
286+
typename xr_vector<COperatorCondition>::const_iterator i = effects.conditions().begin();
287+
typename xr_vector<COperatorCondition>::const_iterator e = effects.conditions().end();
288+
typename xr_vector<COperatorCondition>::const_iterator II = start.conditions().begin();
289+
typename xr_vector<COperatorCondition>::const_iterator EE = start.conditions().end();
290290
for (; (I != E) && (i != e);)
291291
{
292292
if ((*I).condition() < (*i).condition())
@@ -350,10 +350,10 @@ IC const typename CAbstractOperator::CSConditionState& CAbstractOperator::apply(
350350
const CSConditionState& condition, const CSConditionState& self_condition, CSConditionState& result) const
351351
{
352352
result.clear();
353-
xr_vector<COperatorCondition>::const_iterator i = self_condition.conditions().begin();
354-
xr_vector<COperatorCondition>::const_iterator e = self_condition.conditions().end();
355-
xr_vector<COperatorCondition>::const_iterator I = condition.conditions().begin();
356-
xr_vector<COperatorCondition>::const_iterator E = condition.conditions().end();
353+
typename xr_vector<COperatorCondition>::const_iterator i = self_condition.conditions().begin();
354+
typename xr_vector<COperatorCondition>::const_iterator e = self_condition.conditions().end();
355+
typename xr_vector<COperatorCondition>::const_iterator I = condition.conditions().begin();
356+
typename xr_vector<COperatorCondition>::const_iterator E = condition.conditions().end();
357357
for (; (I != E) && (i != e);)
358358
if ((*I).condition() < (*i).condition())
359359
{
@@ -401,10 +401,10 @@ IC typename CAbstractOperator::_edge_value_type CAbstractOperator::min_weight()
401401
return (m_min_weight);
402402

403403
m_min_weight = 0;
404-
xr_vector<COperatorCondition>::const_iterator I = conditions().conditions().begin();
405-
xr_vector<COperatorCondition>::const_iterator E = conditions().conditions().end();
406-
xr_vector<COperatorCondition>::const_iterator i = effects().conditions().begin();
407-
xr_vector<COperatorCondition>::const_iterator e = effects().conditions().end();
404+
typename xr_vector<COperatorCondition>::const_iterator I = conditions().conditions().begin();
405+
typename xr_vector<COperatorCondition>::const_iterator E = conditions().conditions().end();
406+
typename xr_vector<COperatorCondition>::const_iterator i = effects().conditions().begin();
407+
typename xr_vector<COperatorCondition>::const_iterator e = effects().conditions().end();
408408
for (; (i != e) && (I != E);)
409409
{
410410
if ((*I).condition() < (*i).condition())

src/xrAICore/Components/problem_solver.h

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,10 @@ class CProblemSolver
3434
typedef _operator COperator;
3535
typedef _condition_state CState;
3636
typedef _condition_evaluator CConditionEvaluator;
37+
#ifdef WINDOWS
3738
typedef _operator_ptr _operator_ptr;
3839
typedef _condition_evaluator_ptr _condition_evaluator_ptr;
40+
#endif
3941
typedef typename _operator_condition::_condition_type _condition_type;
4042
typedef typename _operator_condition::_value_type _value_type;
4143
typedef typename _operator::_edge_value_type _edge_value_type;
@@ -47,8 +49,8 @@ class CProblemSolver
4749
_operator_id_type m_operator_id;
4850
_operator_ptr m_operator;
4951

50-
IC SOperator(const _operator_id_type& operator_id, _operator_ptr _operator)
51-
: m_operator_id(operator_id), m_operator(_operator)
52+
IC SOperator(const _operator_id_type& operator_id, _operator_ptr _op)
53+
: m_operator_id(operator_id), m_operator(_op)
5254
{
5355
}
5456

@@ -72,13 +74,13 @@ class CProblemSolver
7274
bool m_failed;
7375

7476
private:
75-
template <bool>
76-
IC bool is_goal_reached_impl(const _index_type& vertex_index) const
77+
template <bool a>
78+
IC bool is_goal_reached_impl(std::enable_if_t<!a, const _index_type&> vertex_index) const
7779
{
7880
return is_goal_reached_impl(vertex_index);
7981
}
80-
template <>
81-
IC bool is_goal_reached_impl<true>(const _index_type& vertex_index) const
82+
template <bool a>
83+
IC bool is_goal_reached_impl(std::enable_if_t<a, const _index_type&> vertex_index) const
8284
{
8385
return is_goal_reached_impl(vertex_index, true);
8486
}
@@ -131,9 +133,9 @@ class CProblemSolver
131133
IC _edge_value_type estimate_edge_weight(const _index_type& vertex_index) const;
132134

133135
// operator interface
134-
IC virtual void add_operator(const _edge_type& operator_id, _operator_ptr _operator);
136+
IC virtual void add_operator(const _edge_type& operator_id, _operator_ptr _op);
135137
IC virtual void remove_operator(const _edge_type& operator_id);
136-
IC _operator_ptr get_operator(const _operator_id_type& operator_id);
138+
IC _operator_ptr get_operator(const _edge_type& operator_id);
137139
IC const OPERATOR_VECTOR& operators() const;
138140

139141
// state interface

0 commit comments

Comments
 (0)