|
class | PulsarFriend |
|
class | ClientImpl |
|
◆ TableView()
pulsar::TableView::TableView |
( |
| ) |
|
Construct an uninitialized tableView object
◆ close()
Result pulsar::TableView::close |
( |
| ) |
|
Close the table view and stop the broker to push more messages
◆ closeAsync()
Asynchronously close the tableview and stop the broker to push more messages
◆ containsKey()
bool pulsar::TableView::containsKey |
( |
const std::string & |
key | ) |
const |
Check if the key exists in the table view.
- Returns
- true if the key exists in the table view
◆ forEach()
void pulsar::TableView::forEach |
( |
TableViewAction |
action | ) |
|
Performs the given action for each entry in this map until all entries have been processed or the action throws an exception.
◆ forEachAndListen()
void pulsar::TableView::forEachAndListen |
( |
TableViewAction |
action | ) |
|
Performs the given action for each entry in this map until all entries have been processed and register the callback, which will be called each time a key-value pair is updated.
◆ getValue()
bool pulsar::TableView::getValue |
( |
const std::string & |
key, |
|
|
std::string & |
value |
|
) |
| const |
It's similar with retrievedValue except the value is copied into value
.
- Parameters
-
key | |
value | the value associated with the key |
- Returns
- Whether the key exists in the table view.
◆ retrieveValue()
bool pulsar::TableView::retrieveValue |
( |
const std::string & |
key, |
|
|
std::string & |
value |
|
) |
| |
Move the latest value associated with the key.
Example:
++
std::string value;
while (true) {
std::cout << "value is updated to: " << value;
} else {
}
}
Definition TableView.h:38
bool retrieveValue(const std::string &key, std::string &value)
- Parameters
-
key | |
value | the value associated with the key |
- Returns
- true if there is an associated value of the key, otherwise false
NOTE: Once the value has been retrieved successfully, the associated value will be removed from the table view until next time the value is updated.
◆ size()
std::size_t pulsar::TableView::size |
( |
| ) |
const |
Get the size of the elements.
◆ snapshot()
std::unordered_map< std::string, std::string > pulsar::TableView::snapshot |
( |
| ) |
|
Move the table view data into the unordered map.
The documentation for this class was generated from the following file: