|
1 | | -// copyright (c) openFrameworks team 2010-2017 |
| 1 | +// copyright (c) openFrameworks team 2010-2023 |
2 | 2 | // copyright (c) Damian Stewart 2007-2009 |
3 | 3 | #include "ofxOscBundle.h" |
4 | 4 |
|
5 | 5 | //-------------------------------------------------------------- |
6 | | -ofxOscBundle::ofxOscBundle(const ofxOscBundle &other){ |
| 6 | +ofxOscBundle::ofxOscBundle(const ofxOscBundle & other) { |
7 | 7 | copy(other); |
8 | 8 | } |
9 | 9 |
|
10 | 10 | //-------------------------------------------------------------- |
11 | | -ofxOscBundle& ofxOscBundle::operator=(const ofxOscBundle &other){ |
| 11 | +ofxOscBundle & ofxOscBundle::operator=(const ofxOscBundle & other) { |
12 | 12 | return copy(other); |
13 | 13 | } |
14 | 14 |
|
15 | 15 | //-------------------------------------------------------------- |
16 | | -ofxOscBundle& ofxOscBundle::copy(const ofxOscBundle &other){ |
17 | | - if(this == &other) return *this; |
| 16 | +ofxOscBundle & ofxOscBundle::copy(const ofxOscBundle & other) { |
| 17 | + if (this == &other) return *this; |
18 | 18 |
|
19 | 19 | std::copy(other.bundles.begin(), |
20 | | - other.bundles.end(), |
21 | | - std::back_inserter(bundles)); |
| 20 | + other.bundles.end(), |
| 21 | + std::back_inserter(bundles)); |
22 | 22 |
|
23 | 23 | std::copy(other.messages.begin(), |
24 | | - other.messages.end(), |
25 | | - std::back_inserter(messages)); |
| 24 | + other.messages.end(), |
| 25 | + std::back_inserter(messages)); |
26 | 26 |
|
27 | 27 | return *this; |
28 | 28 | } |
29 | 29 |
|
30 | 30 | //-------------------------------------------------------------- |
31 | | -void ofxOscBundle::clear(){ |
| 31 | +void ofxOscBundle::clear() { |
32 | 32 | bundles.clear(); |
33 | 33 | messages.clear(); |
34 | 34 | } |
35 | 35 |
|
36 | 36 | //-------------------------------------------------------------- |
37 | | -void ofxOscBundle::addBundle(const ofxOscBundle &bundle){ |
| 37 | +void ofxOscBundle::addBundle(const ofxOscBundle & bundle) { |
38 | 38 | bundles.push_back(bundle); |
39 | 39 | } |
40 | 40 |
|
41 | 41 | //-------------------------------------------------------------- |
42 | | -void ofxOscBundle::addMessage(const ofxOscMessage &message){ |
| 42 | +void ofxOscBundle::addMessage(const ofxOscMessage & message) { |
43 | 43 | messages.push_back(message); |
44 | 44 | } |
45 | 45 |
|
46 | 46 | //-------------------------------------------------------------- |
47 | | -int ofxOscBundle::getBundleCount() const{ |
| 47 | +std::size_t ofxOscBundle::getBundleCount() const { |
48 | 48 | return bundles.size(); |
49 | 49 | } |
50 | 50 |
|
51 | 51 | //-------------------------------------------------------------- |
52 | | -int ofxOscBundle::getMessageCount() const{ |
| 52 | +std::size_t ofxOscBundle::getMessageCount() const { |
53 | 53 | return messages.size(); |
54 | 54 | } |
55 | 55 |
|
56 | 56 | //-------------------------------------------------------------- |
57 | | -const ofxOscBundle& ofxOscBundle::getBundleAt(std::size_t i) const{ |
| 57 | +const ofxOscBundle & ofxOscBundle::getBundleAt(std::size_t i) const { |
58 | 58 | return bundles[i]; |
59 | 59 | } |
60 | 60 |
|
61 | 61 | //-------------------------------------------------------------- |
62 | | -ofxOscBundle& ofxOscBundle::getBundleAt(std::size_t i){ |
| 62 | +ofxOscBundle & ofxOscBundle::getBundleAt(std::size_t i) { |
63 | 63 | return bundles[i]; |
64 | 64 | } |
65 | 65 |
|
66 | 66 | //-------------------------------------------------------------- |
67 | | -const ofxOscMessage& ofxOscBundle::getMessageAt(std::size_t i) const{ |
| 67 | +const ofxOscMessage & ofxOscBundle::getMessageAt(std::size_t i) const { |
68 | 68 | return messages[i]; |
69 | 69 | } |
70 | 70 |
|
71 | 71 | //-------------------------------------------------------------- |
72 | | -ofxOscMessage& ofxOscBundle::getMessageAt(std::size_t i){ |
| 72 | +ofxOscMessage & ofxOscBundle::getMessageAt(std::size_t i) { |
73 | 73 | return messages[i]; |
74 | 74 | } |
75 | 75 |
|
76 | 76 | // friend functions |
77 | 77 | //-------------------------------------------------------------- |
78 | | -std::ostream& operator<<(std::ostream &os, const ofxOscBundle &bundle) { |
| 78 | +std::ostream & operator<<(std::ostream & os, const ofxOscBundle & bundle) { |
79 | 79 | os << bundle.getMessageCount() << " message(s) " |
80 | 80 | << bundle.getBundleCount() << " bundle(s)"; |
81 | 81 | return os; |
|
0 commit comments