Skip to content

Commit

Permalink
add comment on is_value_empty()
Browse files Browse the repository at this point in the history
  • Loading branch information
syoyo committed Jul 9, 2024
1 parent e2229f6 commit bd2a1ed
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/prim-types.hh
Original file line number Diff line number Diff line change
Expand Up @@ -1642,6 +1642,12 @@ class TypedAttribute {

void set_value_empty() { _value_empty = true; }

//
// Check if the attribute is authored, but no value(including ValueBlock) assigned.
// e.g.
//
// float myval;
//
bool is_value_empty() const {
if (has_connections()) {
return false;
Expand All @@ -1658,7 +1664,7 @@ class TypedAttribute {
return _value_empty;
}

// value set?
// The attribute authroed?
bool authored() const {
if (_attrib) {
return true;
Expand Down Expand Up @@ -1803,6 +1809,12 @@ class TypedAttributeWithFallback {

bool has_connections() const { return _paths.size(); }

//
// Check if the attribute is authored, but no value(including ValueBlock) assigned.
// e.g.
//
// float myval;
//
bool is_value_empty() const {
if (has_connections()) {
return false;
Expand Down

0 comments on commit bd2a1ed

Please sign in to comment.