Skip to content

Commit

Permalink
[docs] Fixing the documentation according to the new Space definition.
Browse files Browse the repository at this point in the history
Signed-off-by: Stéphane Galland <galland@arakhne.org>
  • Loading branch information
gallandarakhneorg committed Apr 30, 2020
1 parent 5d671a1 commit 6ac9bd9
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 70 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,20 +113,14 @@ In order to enable the creation of an instance of [:myspacename!], a space speci
class [:myspacename!] implements [:spacetype!] {
def [:fctname!](callerIdentity : UUID, parameter : Object) {
}
new (id : SpaceID) {
}
def getSpaceID : SpaceID {
}
def getID : SpaceID {
}
def isPseudoEmpty(id : UUID) {
false
}
def getNumberOfStrongParticipants : int {
0
}
def forEachStrongParticipant(cb : (UUID)=>void) {
}
new (id : SpaceID) {}
def getSpaceID : SpaceID {}
def getID : SpaceID {}
def isPseudoEmpty(id : UUID) { false }
def getNumberOfStrongParticipants : int { 0 }
def getNumberOfWeakParticipants : int { 0 }
def forEachStrongParticipant(cb : (UUID)=>void) {}
def forEachWeakParticipant(cb : (UUID)=>void) {}
}
[:On]
class [:myspacespecname]([:myspacename!]Specification) implements SpaceSpecification<[:myspacename!]> {
Expand Down Expand Up @@ -156,22 +150,15 @@ Back to the example, the code for the skill is:
def [:fctname!](parameter : Object)
}
class [:myspacename!] implements [:spacetype!] {
def [:fctname!](callerIdentity : UUID, parameter : Object) {
}
new (id : SpaceID) {
}
def getSpaceID : SpaceID {
}
def getID : SpaceID {
}
def isPseudoEmpty(id : UUID) {
false
}
def getNumberOfStrongParticipants : int {
0
}
def forEachStrongParticipant(cb : (UUID)=>void) {
}
def [:fctname!](callerIdentity : UUID, parameter : Object) {}
new (id : SpaceID) {}
def getSpaceID : SpaceID {}
def getID : SpaceID {}
def isPseudoEmpty(id : UUID) { false }
def getNumberOfStrongParticipants : int { 0 }
def getNumberOfWeakParticipants : int { 0 }
def forEachStrongParticipant(cb : (UUID)=>void) {}
def forEachWeakParticipant(cb : (UUID)=>void) {}
}
class [:myspacespecname]([:myspacename!]Specification) implements SpaceSpecification<[:myspacename!]> {
def create(id : SpaceID, params : Object*) : [:myspacename!] {
Expand Down Expand Up @@ -225,22 +212,15 @@ to give the instance of the caller to the space. The code of the skill becomes:
def [:fctname!](parameter : Object)
}
class [:myspacename!] implements [:spacetype!] {
def [:fctname!](callerIdentity : Object, parameter : Object) {
}
new (id : SpaceID) {
}
def getSpaceID : SpaceID {
}
def getID : SpaceID {
}
def isPseudoEmpty(id : UUID) {
true
}
def getNumberOfStrongParticipants : int {
0
}
def forEachStrongParticipant(cb : (UUID)=>void) {
}
def [:fctname!](callerIdentity : Object, parameter : Object) {}
new (id : SpaceID) {}
def getSpaceID : SpaceID {}
def getID : SpaceID {}
def isPseudoEmpty(id : UUID) { true }
def getNumberOfStrongParticipants : int { 0 }
def getNumberOfWeakParticipants : int { 0 }
def forEachStrongParticipant(cb : (UUID)=>void) {}
def forEachWeakParticipant(cb : (UUID)=>void) {}
}
[:On]
skill [:myskillname](MySkill) implements [:mycapacityname!] {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,30 +177,6 @@ Below, the implementation extends one of the abstract classes provided by the [J
class PhysicSpaceImpl extends AbstractEventSpace implements PhysicSpace {
val [:entityfield](entities) = <[:uuid](UUID), PhysicObject>newHashMap
val strongRepository = new ConcurrentHashMap<UUID, Participant>

var weakRepository : ConcurrentHashMap<UUID, Participant>

override getInternalStrongParticipantStructure(copy : boolean) : ConcurrentHashMap<UUID, Participant> {
if (copy) {
return new ConcurrentHashMap(this.strongRepository)
}
this.strongRepository
}
override getInternalWeakParticipantStructure : ConcurrentHashMap<UUID, Participant> {
this.weakRepository
}

override ensureInternalWeakParticipantStructure : ConcurrentHashMap<UUID, Participant> {
var r = this.weakRepository
if (r === null) {
this.weakRepository = new ConcurrentHashMap
r = this.weakRepository
}
return this.weakRepository
}

def [:moveobjectfct](moveObject)(identifier : UUID, x : float, y : float, z : float) {
synchronized (this.entities) {
var o = this.entities.get(identifier)
Expand Down Expand Up @@ -262,7 +238,9 @@ This specification may create the space instance according to rules, or provide
def getSpaceID : SpaceID { null }
def isPseudoEmpty(id : UUID) : boolean { true }
def getNumberOfStrongParticipants : int { 0 }
def getNumberOfWeakParticipants : int { 0 }
def forEachStrongParticipant(cb : (UUID)=>void) {}
def forEachWeakParticipant(cb : (UUID)=>void) {}
}
[:On]
class PhysicSpaceSpecification implements [:spacespecdef](SpaceSpecification)<PhysicSpace> {
Expand Down Expand Up @@ -311,7 +289,9 @@ The following example illustrates the first method of marking of an object field
def getSpaceID : SpaceID { null }
def isPseudoEmpty(id : UUID) : boolean { true }
def getNumberOfStrongParticipants : int { 0 }
def getNumberOfWeakParticipants : int { 0 }
def forEachStrongParticipant(cb : (UUID)=>void) {}
def forEachWeakParticipant(cb : (UUID)=>void) {}
}
[:On]
class MySpaceSpecification implements SpaceSpecification<MySpace> {
Expand Down Expand Up @@ -346,7 +326,9 @@ The following example illustrates the second method of marking of an object fiel
def getSpaceID : SpaceID { null }
def isPseudoEmpty(id : UUID) : boolean { true }
def getNumberOfStrongParticipants : int { 0 }
def getNumberOfWeakParticipants : int { 0 }
def forEachStrongParticipant(cb : (UUID)=>void) {}
def forEachWeakParticipant(cb : (UUID)=>void) {}
}
[:On]
class MySpaceSpecification implements SpaceSpecification<MySpace> {
Expand Down

0 comments on commit 6ac9bd9

Please sign in to comment.