Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
frama-c
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pub
frama-c
Commits
e9f869c6
Commit
e9f869c6
authored
4 years ago
by
David Bühler
Committed by
Michele Alberti
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[server] Data: standardizes the Identified functor with Index and Static.
parent
84ca6787
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/plugins/server/data.ml
+5
-6
5 additions, 6 deletions
src/plugins/server/data.ml
src/plugins/server/data.mli
+1
-2
1 addition, 2 deletions
src/plugins/server/data.mli
with
6 additions
and
8 deletions
src/plugins/server/data.ml
+
5
−
6
View file @
e9f869c6
...
@@ -632,10 +632,9 @@ module type IdentifiedType =
...
@@ -632,10 +632,9 @@ module type IdentifiedType =
sig
sig
type
t
type
t
val
id
:
t
->
int
val
id
:
t
->
int
include
Info
end
end
module
Identified
(
A
:
IdentifiedType
)
:
Index
with
type
t
=
A
.
t
=
module
Identified
(
A
:
IdentifiedType
)
(
I
:
Info
)
:
Index
with
type
t
=
A
.
t
=
struct
struct
type
index
=
(
int
,
A
.
t
)
Hashtbl
.
t
type
index
=
(
int
,
A
.
t
)
Hashtbl
.
t
...
@@ -646,13 +645,13 @@ struct
...
@@ -646,13 +645,13 @@ struct
type
t
=
index
type
t
=
index
include
Datatype
.
Undefined
include
Datatype
.
Undefined
let
reprs
=
[
Hashtbl
.
create
0
]
let
reprs
=
[
Hashtbl
.
create
0
]
let
name
=
"Server.Data.Identified.Type."
^
A
.
name
let
name
=
"Server.Data.Identified.Type."
^
I
.
name
let
mem_project
=
Datatype
.
never_any_project
let
mem_project
=
Datatype
.
never_any_project
end
)
end
)
module
STATE
=
State_builder
.
Ref
(
TYPE
)
module
STATE
=
State_builder
.
Ref
(
TYPE
)
(
struct
(
struct
let
name
=
"Server.Data.Identified.State."
^
A
.
name
let
name
=
"Server.Data.Identified.State."
^
I
.
name
let
dependencies
=
[]
let
dependencies
=
[]
let
default
()
=
Hashtbl
.
create
0
let
default
()
=
Hashtbl
.
create
0
end
)
end
)
...
@@ -666,12 +665,12 @@ struct
...
@@ -666,12 +665,12 @@ struct
include
Collection
include
Collection
(
struct
(
struct
type
t
=
A
.
t
type
t
=
A
.
t
let
syntax
=
publish_id
(
module
A
)
let
syntax
=
publish_id
(
module
I
)
let
to_json
a
=
`Int
(
get
a
)
let
to_json
a
=
`Int
(
get
a
)
let
of_json
js
=
let
of_json
js
=
let
k
=
Ju
.
to_int
js
in
let
k
=
Ju
.
to_int
js
in
try
find
k
try
find
k
with
Not_found
->
failure
"[%s] No registered id #%d"
A
.
name
k
with
Not_found
->
failure
"[%s] No registered id #%d"
I
.
name
k
end
)
end
)
end
end
...
...
This diff is collapsed.
Click to expand it.
src/plugins/server/data.mli
+
1
−
2
View file @
e9f869c6
...
@@ -321,11 +321,10 @@ module type IdentifiedType =
...
@@ -321,11 +321,10 @@ module type IdentifiedType =
sig
sig
type
t
type
t
val
id
:
t
->
int
val
id
:
t
->
int
include
Info
end
end
(** Builds a {i projectified} index on types with {i unique} identifiers. *)
(** Builds a {i projectified} index on types with {i unique} identifiers. *)
module
Identified
(
A
:
IdentifiedType
)
:
Index
with
type
t
=
A
.
t
module
Identified
(
A
:
IdentifiedType
)
(
I
:
Info
)
:
Index
with
type
t
=
A
.
t
(* -------------------------------------------------------------------------- *)
(* -------------------------------------------------------------------------- *)
(** {2 Error handling}
(** {2 Error handling}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment