Skip to content

Commit

Permalink
fixs smreal bug
Browse files Browse the repository at this point in the history
  • Loading branch information
msupernaw committed Nov 18, 2023
1 parent cf3b817 commit f1d2e09
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
2 changes: 1 addition & 1 deletion inst/include/SharedRList.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ class SharedList : public SharedRObject {
} else if (type == SMTYPE::SMNUMERIC) {

t.sm_name = "na";
t.type = SMTYPE::SMLIST;
t.type = SMTYPE::SMNUMERIC;
t.data = object;
t.value = Rcpp::as<double>(object);
(*this->tlist_m)[key] = t;
Expand Down
27 changes: 14 additions & 13 deletions test/test_sm.R
Original file line number Diff line number Diff line change
Expand Up @@ -67,23 +67,23 @@ if (parent == TRUE) {#parent process

SML <- new(processR::SharedList)
SML$create("SML")
# SML$set(sm_name, SMV)
SML$set(sm_name, SMV)


SML2 <- new(processR::SharedList)
SML2$open("SML")
# SML2 <- new(processR::SharedList)
# SML2$open("SML")
# SMV2<-SML2$get(sm_name)
pi<- 3.1549
print(typeof(pi))
SML2$set("PI",3.1549)
print(SML2$get("PI"))
q()
# pi<- 3.1549
# print(typeof(pi))
# SML2$set("PI",3.1549)
# print(SML2$get("PI"))
# q()
# SML2$set("double", 3,1459)
# PI_ <-SML$get("double")
# print(PI_)
print(SMV2$size())
print(typeof(SMV2))
print(SMV2$size())
# print(SMV2$size())
# print(typeof(SMV2))
# print(SMV2$size())



Expand Down Expand Up @@ -139,10 +139,11 @@ if (parent == TRUE) {#parent process
#
SML <- new(processR::SharedList)
SML$open("SML")

SMV<-SML$get(sm_name)
SML$set("PI",3.1549)
# print(SMV2$size())
# show(SMV)
show(SMV)

print("still child")
#modify segment of the shared vector
Expand Down

0 comments on commit f1d2e09

Please sign in to comment.