Package org.robwork.sdurw_kinematics
Class StateDataCPtr
- java.lang.Object
-
- org.robwork.sdurw_kinematics.StateDataCPtr
-
public class StateDataCPtr extends java.lang.Object
Ptr stores a pointer and optionally takes ownership of the value.
-
-
Constructor Summary
Constructors Constructor Description StateDataCPtr()
Default constructor yielding a NULL-pointer.StateDataCPtr(long cPtr, boolean cMemoryOwn)
StateDataCPtr(StateData ptr)
Do not take ownership of ptr.
ptr can be null.
The constructor is implicit on purpose.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description StateData
__ref__()
Dereferencing operator.void
delete()
StateData
deref()
The pointer stored in the object.boolean
equals(StateData p)
StateCachePtr
getCache(State state)
Get the cache.static long
getCPtr(StateDataCPtr obj)
StateData
getDeref()
Member access operator.int
getID()
An integer ID for the StateData.
IDs are assigned to the state data upon insertion State.
StateData that are not in a State have an ID of -1.
StateData present in different trees may have identical IDs.
IDs are used for the efficient implementation of State.java.lang.String
getName()
The name of the state data.
boolean
hasCache()
Check is state data includes a cache.boolean
isNull()
checks if the pointer is nullboolean
isShared()
check if this Ptr has shared ownership or none
ownershipvoid
setData(State state, double val)
Assign for state data the size() of values of the array
vals.
The array vals must be of length at least size().
void
setData(State state, vector_d vals)
Assign for state data the size() of values of the array
vals.
The array vals must be of length at least size().
int
size()
The number of doubles allocated by this StateData in
each State object.
-
-
-
Constructor Detail
-
StateDataCPtr
public StateDataCPtr(long cPtr, boolean cMemoryOwn)
-
StateDataCPtr
public StateDataCPtr()
Default constructor yielding a NULL-pointer.
-
StateDataCPtr
public StateDataCPtr(StateData ptr)
Do not take ownership of ptr.
ptr can be null.
The constructor is implicit on purpose.
-
-
Method Detail
-
getCPtr
public static long getCPtr(StateDataCPtr obj)
-
delete
public void delete()
-
deref
public StateData deref()
The pointer stored in the object.
-
__ref__
public StateData __ref__()
Dereferencing operator.
-
getDeref
public StateData getDeref()
Member access operator.
-
equals
public boolean equals(StateData p)
-
isShared
public boolean isShared()
check if this Ptr has shared ownership or none
ownership- Returns:
- true if Ptr has shared ownership, false if it has no ownership.
-
isNull
public boolean isNull()
checks if the pointer is null- Returns:
- Returns true if the pointer is null
-
getID
public int getID()
An integer ID for the StateData.
IDs are assigned to the state data upon insertion State.
StateData that are not in a State have an ID of -1.
StateData present in different trees may have identical IDs.
IDs are used for the efficient implementation of State. Normally,
you should not make use of StateData IDs yourself.
- Returns:
- An integer ID for the frame.
-
getName
public java.lang.String getName()
The name of the state data.
- Returns:
- The name of the state data.
-
size
public int size()
The number of doubles allocated by this StateData in
each State object.
- Returns:
- The number of doubles allocated by the StateData
-
setData
public void setData(State state, vector_d vals)
Assign for state data the size() of values of the array
vals.
The array vals must be of length at least size().
- Parameters:
state
- [inout] The state to which vals are written.
vals
- [in] The joint values to assign.
setData() and getData() are related as follows:
data.setData(state, q_in); const double* q_out = data.getData(state); for (int i = 0; i < data.getDOF(); i++) q_in[i] == q_out[i];
-
setData
public void setData(State state, double val)
Assign for state data the size() of values of the array
vals.
The array vals must be of length at least size().
- Parameters:
state
- [inout] The state to which vals are written.
setData() and getData() are related as follows:
data.setData(state, q_in); const double* q_out = data.getData(state); for (int i = 0; i < data.getDOF(); i++) q_in[i] == q_out[i];
-
hasCache
public boolean hasCache()
Check is state data includes a cache.- Returns:
- true if cache, false otherwise.
-
getCache
public StateCachePtr getCache(State state)
Get the cache.- Parameters:
state
- [in] the state.- Returns:
- the cache.
-
-