How does ddo() pass control to updateAttributes

7 views
Skip to first unread message

jeremiah rounds

unread,
Oct 6, 2015, 2:49:16 PM10/6/15
to Tessera-Users


I was inspecting datadr source code and I got curious about something: how does control from ddo(control=control) get passed or used in updateAttributes(res)?   Function body from datadr source follows:



ddo <- function(conn, update = FALSE, reset = FALSE, control = NULL, verbose = TRUE) {
  # ddoInit should attach the conn attribute and add the ddo class to the object
  res <- ddoInit(conn)
  class(res) <- c("ddo", class(res))
  conn <- ddoInitConn(conn)

  attrs <- loadAttrs(conn, type = "ddo")
  if(length(attrs) == 0 || reset) {
    # if(verbose)
    #   message("* Getting basic 'ddo' attributes...")
    attrs <- getBasicDdoAttrs(res, conn)
    attrs <- initAttrs(res, attrs, type = "ddo")
  } else {
    if(verbose)
      message("* Reading in existing 'ddo' attributes")
  }
  res <- setAttributes(res, attrs)

  # update attributes based on conn
  if(update)
    res <- updateAttributes(res)

  res
}
Reply all
Reply to author
Forward
0 new messages