Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Dubský Jan
asgn
Commits
1962ae87
Commit
1962ae87
authored
Mar 19, 2020
by
Bednárek David RNDr. Ph.D.
Browse files
well_defined_hash
parent
a225d4bd
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
asgn/fmwkng.hpp
View file @
1962ae87
...
...
@@ -4197,6 +4197,21 @@ namespace fmwkng {
std
::
size_t
mod_
;
};
#pragma endregion
#pragma region hash
class
well_defined_hash
{
public:
using
result_type
=
std
::
uint64_t
;
result_type
operator
()(
std
::
string_view
s
)
{
result_type
h
=
0
;
for
(
auto
c
:
s
)
{
h
=
(
h
<<
9
)
^
(
h
>>
55
)
^
std
::
uint8_t
(
c
);
}
return
h
;
}
};
#pragma endregion
}
#endif
asgn/macroasgn.hpp
View file @
1962ae87
...
...
@@ -160,7 +160,7 @@ namespace macromain {
using
tag_category
=
fmwkng
::
result_tag_category
;
static
auto
name
()
{
return
"output_hash"
;
}
static
auto
code_name
()
{
return
"macromain::output_hash"
;
}
using
value_type
=
std
::
size_t
;
using
value_type
=
fmwkng
::
well_defined_hash
::
result_type
;
};
struct
root_config
{
...
...
asgn/macrogold.cpp
View file @
1962ae87
This diff is collapsed.
Click to expand it.
asgn/macrogolddebug.cpp
View file @
1962ae87
...
...
@@ -12,7 +12,7 @@ namespace macromain {
std
::
make_unique
<
fmwkng
::
impl
::
config_element
<
macromain
::
lines
,
fmwkng
::
impl
::
element_sense
::
OPEN
>>
(
1600
),
},
{
std
::
make_unique
<
fmwkng
::
impl
::
element_t
<
macromain
::
output_hash
,
fmwkng
::
impl
::
element_sense
::
CLOSE
>>
(
6098797632107618844
U
),
std
::
make_unique
<
fmwkng
::
impl
::
element_t
<
macromain
::
output_hash
,
fmwkng
::
impl
::
element_sense
::
CLOSE
>>
(
17197085183543559838
U
),
}
},
{
...
...
@@ -22,7 +22,7 @@ namespace macromain {
std
::
make_unique
<
fmwkng
::
impl
::
config_element
<
macromain
::
lines
,
fmwkng
::
impl
::
element_sense
::
OPEN
>>
(
400
),
},
{
std
::
make_unique
<
fmwkng
::
impl
::
element_t
<
macromain
::
output_hash
,
fmwkng
::
impl
::
element_sense
::
CLOSE
>>
(
5626602103339740094
U
),
std
::
make_unique
<
fmwkng
::
impl
::
element_t
<
macromain
::
output_hash
,
fmwkng
::
impl
::
element_sense
::
CLOSE
>>
(
13220193331699835243
U
),
}
},
{
...
...
@@ -32,7 +32,7 @@ namespace macromain {
std
::
make_unique
<
fmwkng
::
impl
::
config_element
<
macromain
::
lines
,
fmwkng
::
impl
::
element_sense
::
OPEN
>>
(
1600
),
},
{
std
::
make_unique
<
fmwkng
::
impl
::
element_t
<
macromain
::
output_hash
,
fmwkng
::
impl
::
element_sense
::
CLOSE
>>
(
17091110401245677638
U
),
std
::
make_unique
<
fmwkng
::
impl
::
element_t
<
macromain
::
output_hash
,
fmwkng
::
impl
::
element_sense
::
CLOSE
>>
(
4410665444513865852
U
),
}
},
{
...
...
@@ -42,7 +42,7 @@ namespace macromain {
std
::
make_unique
<
fmwkng
::
impl
::
config_element
<
macromain
::
lines
,
fmwkng
::
impl
::
element_sense
::
OPEN
>>
(
400
),
},
{
std
::
make_unique
<
fmwkng
::
impl
::
element_t
<
macromain
::
output_hash
,
fmwkng
::
impl
::
element_sense
::
CLOSE
>>
(
3793603356625390693
U
),
std
::
make_unique
<
fmwkng
::
impl
::
element_t
<
macromain
::
output_hash
,
fmwkng
::
impl
::
element_sense
::
CLOSE
>>
(
16473863340873376882
U
),
}
},
{
...
...
@@ -52,7 +52,7 @@ namespace macromain {
std
::
make_unique
<
fmwkng
::
impl
::
config_element
<
macromain
::
lines
,
fmwkng
::
impl
::
element_sense
::
OPEN
>>
(
1600
),
},
{
std
::
make_unique
<
fmwkng
::
impl
::
element_t
<
macromain
::
output_hash
,
fmwkng
::
impl
::
element_sense
::
CLOSE
>>
(
6098797632107618844
U
),
std
::
make_unique
<
fmwkng
::
impl
::
element_t
<
macromain
::
output_hash
,
fmwkng
::
impl
::
element_sense
::
CLOSE
>>
(
17197085183543559838
U
),
}
},
{
...
...
@@ -62,7 +62,7 @@ namespace macromain {
std
::
make_unique
<
fmwkng
::
impl
::
config_element
<
macromain
::
lines
,
fmwkng
::
impl
::
element_sense
::
OPEN
>>
(
1600
),
},
{
std
::
make_unique
<
fmwkng
::
impl
::
element_t
<
macromain
::
output_hash
,
fmwkng
::
impl
::
element_sense
::
CLOSE
>>
(
17091110401245677638
U
),
std
::
make_unique
<
fmwkng
::
impl
::
element_t
<
macromain
::
output_hash
,
fmwkng
::
impl
::
element_sense
::
CLOSE
>>
(
4410665444513865852
U
),
}
},
{
...
...
@@ -72,7 +72,7 @@ namespace macromain {
std
::
make_unique
<
fmwkng
::
impl
::
config_element
<
macromain
::
lines
,
fmwkng
::
impl
::
element_sense
::
OPEN
>>
(
1600
),
},
{
std
::
make_unique
<
fmwkng
::
impl
::
element_t
<
macromain
::
output_hash
,
fmwkng
::
impl
::
element_sense
::
CLOSE
>>
(
6098797632107618844
U
),
std
::
make_unique
<
fmwkng
::
impl
::
element_t
<
macromain
::
output_hash
,
fmwkng
::
impl
::
element_sense
::
CLOSE
>>
(
17197085183543559838
U
),
}
},
{
...
...
@@ -83,7 +83,7 @@ namespace macromain {
std
::
make_unique
<
fmwkng
::
impl
::
config_element
<
macromain
::
lines
,
fmwkng
::
impl
::
element_sense
::
OPEN
>>
(
1600
),
},
{
std
::
make_unique
<
fmwkng
::
impl
::
element_t
<
macromain
::
output_hash
,
fmwkng
::
impl
::
element_sense
::
CLOSE
>>
(
6098797632107618844
U
),
std
::
make_unique
<
fmwkng
::
impl
::
element_t
<
macromain
::
output_hash
,
fmwkng
::
impl
::
element_sense
::
CLOSE
>>
(
17197085183543559838
U
),
}
},
};
...
...
asgn/macromain.cpp
View file @
1962ae87
...
...
@@ -60,7 +60,7 @@ namespace macromain {
macrosol
::
macroprocessor
<
macrosol
::
policy_scalar
>
mp
;
mg
.
rewind
();
mg
.
advance
(
count
<
lines
>
(
ctx5
));
std
::
size_t
h
=
0
;
fmwkng
::
well_defined_hash
::
result_type
h
=
0
;
std
::
string
output
;
for
(;;)
{
...
...
@@ -70,7 +70,7 @@ namespace macromain {
output
.
clear
();
auto
rv2
=
mp
.
process
(
*
rv
,
output
);
if
(
rv2
)
h
+=
std
::
hash
<
std
::
string
>
()(
output
);
h
+=
fmwkng
::
well_defined_hash
()(
output
);
}
if
(
stop_for_results
(
ctx5
))
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment