473,915 Members | 4,402 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

static vector of pointers

Jia
Hi all,

I have a class foo which has a static vector of pointers of type base
class, and a static function to set this vector.

#include <iostream>
#include <vector>
using namespace std;
class super{
protected:
int a;
public:
virtual void printOut(){ cout << "super " << endl;}
};

class subA : public super{
protected:
int a_a;
public:
virtual void printOut(){ cout << "subA" << endl;}
};

class subB : public super{
protected:
int a_b;
public:
virtual void printOut(){cout << "subB" << endl;}
};

class foo {
protected:
static std::vector<sup er*myList;
static std::vector<sta tic subAtemplist;
static int count;
public:
static void setMyList();
static vector<super*ge tMyList();
};

std::vector<sup er*>foo::myList ;
std::vector<sub Afoo::templist;
int foo:: count = 0;
void foo::setMyList( ){
subA mysubA;
templist.push_b ack(mysubA);
myList.push_bac k(&(templist[count]));
count++;
cout<< count << " time call setMyList" << endl;
}

vector<super*fo o::getMyList()
{
return myList;
}

main()
{

foo::setMyList( );
foo::setMyList( );

vector<super*ne wList;
newList = foo::getMyList( );
newList[0]->printOut();
}
What I really try to achieve is to set the myList to a vector of
pointers of super type, but actually points to the derived class
objects. I use a static vector of subA to store the sub object, so
that I could use its address to initilize myList( I know this is very
ugly, but I haven't figure out other method). But my problem is that
myList is not properly set as I expected. For example, as above
program will crush as try to execute newList[0]->printOut(). I
figured out that everytime templist calls push_back, its address has
been changed ( the first time is 0x0033c10, and second time after
push_back is called, its address has been changed) so that myList
first pointer points to nowhere, but I have already defined the
templist as static. Can anyone explain this to me? I hope I explain
myself clearly.

Apr 20 '07 #1
6 4015
On Apr 20, 11:21 am, Jia <JiaLi...@gmail .comwrote:
Hi all,

I have a class foo which has a static vector of pointers of type base
class, and a static function to set this vector.

#include <iostream>
#include <vector>
using namespace std;
class super{
protected:
int a;
public:
virtual void printOut(){ cout << "super " << endl;}

};

class subA : public super{
protected:
int a_a;
public:
virtual void printOut(){ cout << "subA" << endl;}

};

class subB : public super{
protected:
int a_b;
public:
virtual void printOut(){cout << "subB" << endl;}

};

class foo {
protected:
static std::vector<sup er*myList;
static std::vector<sta tic subAtemplist;
static int count;
public:
static void setMyList();
static vector<super*ge tMyList();

};

std::vector<sup er*>foo::myList ;
std::vector<sub Afoo::templist;
int foo:: count = 0;
void foo::setMyList( ){
subA mysubA;
templist.push_b ack(mysubA);
myList.push_bac k(&(templist[count]));
count++;
cout<< count << " time call setMyList" << endl;

}

vector<super*fo o::getMyList()
{
return myList;

}

main()
{

foo::setMyList( );
foo::setMyList( );

vector<super*ne wList;
newList = foo::getMyList( );
newList[0]->printOut();}

What I really try to achieve is to set the myList to a vector of
pointers of super type, but actually points to the derived class
objects. I use a static vector of subA to store the sub object, so
that I could use its address to initilize myList( I know this is very
ugly, but I haven't figure out other method). But my problem is that
myList is not properly set as I expected. For example, as above
program will crush as try to execute newList[0]->printOut(). I
figured out that everytime templist calls push_back, its address has
been changed ( the first time is 0x0033c10, and second time after
push_back is called, its address has been changed) so that myList
first pointer points to nowhere, but I have already defined the
templist as static. Can anyone explain this to me? I hope I explain
myself clearly.
Apparently my previous response didn't go through or has been delayed.
The fundamental problem is that templist is being resized by the
push_back, which invalidates all pointers and iterators. Try this
instead:
#include <iostream>
#include <vector>
using namespace std;

struct super
{
virtual ~super() {}
virtual void printOut()
{ cout << "super\n";}
};

struct subA : super
{
virtual void printOut()
{ cout << "subA\n"; }
};

class foo
{
vector<super*my List;
public:
~foo()
{
for( size_t n=0; n < myList.size(); ++n )
{
delete myList[n];
}
}

void setMyList()
{
myList.push_bac k( new subA );
cout<< "called setMyList" << endl;
}

vector<super*ge tMyList() const
{
return myList;
}
};

int main()
{
foo f;
f.setMyList();
f.setMyList();

const vector<super*ne wList = f.getMyList();
for( size_t n=0; n < newList.size(); ++n )
{
newList[n]->printOut();
}
}

Cheers! --M

Apr 20 '07 #2
Jia
On 20 Apr, 22:12, mlimber <mlim...@gmail. comwrote:
On Apr 20, 11:21 am, Jia <JiaLi...@gmail .comwrote:
Hi all,
I have a class foo which has a static vector of pointers of type base
class, and a static function to set this vector.
#include <iostream>
#include <vector>
using namespace std;
class super{
protected:
int a;
public:
virtual void printOut(){ cout << "super " << endl;}
};
class subA : public super{
protected:
int a_a;
public:
virtual void printOut(){ cout << "subA" << endl;}
};
class subB : public super{
protected:
int a_b;
public:
virtual void printOut(){cout << "subB" << endl;}
};
class foo {
protected:
static std::vector<sup er*myList;
static std::vector<sta tic subAtemplist;
static int count;
public:
static void setMyList();
static vector<super*ge tMyList();
};
std::vector<sup er*>foo::myList ;
std::vector<sub Afoo::templist;
int foo:: count = 0;
void foo::setMyList( ){
subA mysubA;
templist.push_b ack(mysubA);
myList.push_bac k(&(templist[count]));
count++;
cout<< count << " time call setMyList" << endl;
}
vector<super*fo o::getMyList()
{
return myList;
}
main()
{
foo::setMyList( );
foo::setMyList( );
vector<super*ne wList;
newList = foo::getMyList( );
newList[0]->printOut();}
What I really try to achieve is to set the myList to a vector of
pointers of super type, but actually points to the derived class
objects. I use a static vector of subA to store the sub object, so
that I could use its address to initilize myList( I know this is very
ugly, but I haven't figure out other method). But my problem is that
myList is not properly set as I expected. For example, as above
program will crush as try to execute newList[0]->printOut(). I
figured out that everytime templist calls push_back, its address has
been changed ( the first time is 0x0033c10, and second time after
push_back is called, its address has been changed) so that myList
first pointer points to nowhere, but I have already defined the
templist as static. Can anyone explain this to me? I hope I explain
myself clearly.

Apparently my previous response didn't go through or has been delayed.
The fundamental problem is that templist is being resized by the
push_back, which invalidates all pointers and iterators. Try this
instead:
#include <iostream>
#include <vector>
using namespace std;

struct super
{
virtual ~super() {}
virtual void printOut()
{ cout << "super\n";}
};

struct subA : super
{
virtual void printOut()
{ cout << "subA\n"; }
};

class foo
{
vector<super*my List;
public:
~foo()
{
for( size_t n=0; n < myList.size(); ++n )
{
delete myList[n];
}
}

void setMyList()
{
myList.push_bac k( new subA );
cout<< "called setMyList" << endl;
}

vector<super*ge tMyList() const
{
return myList;
}
};

int main()
{
foo f;
f.setMyList();
f.setMyList();

const vector<super*ne wList = f.getMyList();
for( size_t n=0; n < newList.size(); ++n )
{
newList[n]->printOut();
}
}

Cheers! --M
Thanks a lot. Your program makes much more sense than mine. Just want
to ask you a further question(sorrry if it is stupid). Does resize
means that everytime calls push_back(), the first address of memory
will change (not just adding the memory on the existing one)?

Many thanks,
Jia
Apr 21 '07 #3
On Apr 20, 8:09 pm, Jia <JiaLi...@gmail .comwrote:
On 20 Apr, 22:12, mlimber <mlim...@gmail. comwrote:
On Apr 20, 11:21 am, Jia <JiaLi...@gmail .comwrote:
Hi all,
I have a class foo which has a static vector of pointers of type base
class, and a static function to set this vector.
#include <iostream>
#include <vector>
using namespace std;
class super{
protected:
int a;
public:
virtual void printOut(){ cout << "super " << endl;}
};
class subA : public super{
protected:
int a_a;
public:
virtual void printOut(){ cout << "subA" << endl;}
};
class subB : public super{
protected:
int a_b;
public:
virtual void printOut(){cout << "subB" << endl;}
};
class foo {
protected:
static std::vector<sup er*myList;
static std::vector<sta tic subAtemplist;
static int count;
public:
static void setMyList();
static vector<super*ge tMyList();
};
std::vector<sup er*>foo::myList ;
std::vector<sub Afoo::templist;
int foo:: count = 0;
void foo::setMyList( ){
subA mysubA;
templist.push_b ack(mysubA);
myList.push_bac k(&(templist[count]));
count++;
cout<< count << " time call setMyList" << endl;
}
vector<super*fo o::getMyList()
{
return myList;
}
main()
{
foo::setMyList( );
foo::setMyList( );
vector<super*ne wList;
newList = foo::getMyList( );
newList[0]->printOut();}
What I really try to achieve is to set the myList to a vector of
pointers of super type, but actually points to the derived class
objects. I use a static vector of subA to store the sub object, so
that I could use its address to initilize myList( I know this is very
ugly, but I haven't figure out other method). But my problem is that
myList is not properly set as I expected. For example, as above
program will crush as try to execute newList[0]->printOut(). I
figured out that everytime templist calls push_back, its address has
been changed ( the first time is 0x0033c10, and second time after
push_back is called, its address has been changed) so that myList
first pointer points to nowhere, but I have already defined the
templist as static. Can anyone explain this to me? I hope I explain
myself clearly.
Apparently my previous response didn't go through or has been delayed.
The fundamental problem is that templist is being resized by the
push_back, which invalidates all pointers and iterators. Try this
instead:
#include <iostream>
#include <vector>
using namespace std;
struct super
{
virtual ~super() {}
virtual void printOut()
{ cout << "super\n";}
};
struct subA : super
{
virtual void printOut()
{ cout << "subA\n"; }
};
class foo
{
vector<super*my List;
public:
~foo()
{
for( size_t n=0; n < myList.size(); ++n )
{
delete myList[n];
}
}
void setMyList()
{
myList.push_bac k( new subA );
cout<< "called setMyList" << endl;
}
vector<super*ge tMyList() const
{
return myList;
}
};
int main()
{
foo f;
f.setMyList();
f.setMyList();
const vector<super*ne wList = f.getMyList();
for( size_t n=0; n < newList.size(); ++n )
{
newList[n]->printOut();
}
}
Cheers! --M

Thanks a lot. Your program makes much more sense than mine. Just want
to ask you a further question(sorrry if it is stupid). Does resize
means that everytime calls push_back(), the first address of memory
will change (not just adding the memory on the existing one)?
Not necessarily, but it could. It depends on whether or not there is
unused capacity in the vector where the new element could be created.
You can use the reserve member function to specify the desired
capacity (which is different from the size), and when the capacity is
exceeded on push_back, the vector will grow by doubling its capacity
and then increasing its size by one. If the capacity is not exceeded,
no growing is necessary, so iterators and pointers are not
invalidated.

BTW, a couple of other remarks about your program that were lost from
my original reply:

Returning the vector like this:

vector<super*ne wList;
newList = foo::getMyList( );

instead of like this:

vector<super*ne wList = foo::getMyList( );

will likely introduce an extra, temporary copy of the vector. The
latter makes use of the return value optimization to eliminate this
copy.

In any case, it's usually better to hide your underlying
representation via encapsulation (see
http://www.parashift.com/c++-faq-lit....html#faq-7.4),
which in this case would likely mean that you give foo a member
function to do the printing for all of its "super" objects rather than
handing out copies of the vector in which it holds them.

Note that I added a virtual destructor to super (see
http://www.parashift.com/c++-faq-lit...html#faq-20.7).

Also, instead of using the destructor that I added to foo, you could
use a smart pointer with container-compatible copy semantics, such as
std::tr1::share d_ptr (aka boost::shared_p tr), Loki::SmartPtr (with
reference counting policies etc.), or the reference counted smart
pointer from this FAQ and those following:

http://www.parashift.com/c++-faq-lit...html#faq-16.22

I omitted this for brevity and clarity, but it's what I would use in
your shoes.

Cheers! --M

Apr 21 '07 #4
On Apr 21, 2:09 am, Jia <JiaLi...@gmail .comwrote:
On 20 Apr, 22:12, mlimber <mlim...@gmail. comwrote:
On Apr 20, 11:21 am, Jia <JiaLi...@gmail .comwrote:
Hi all,
I have a class foo which has a static vector of pointers of type base
class, and a static function to set this vector.
#include <iostream>
#include <vector>
using namespace std;
class super{
protected:
int a;
public:
virtual void printOut(){ cout << "super " << endl;}
};
class subA : public super{
protected:
int a_a;
public:
virtual void printOut(){ cout << "subA" << endl;}
};
class subB : public super{
protected:
int a_b;
public:
virtual void printOut(){cout << "subB" << endl;}
};
class foo {
protected:
static std::vector<sup er*myList;
static std::vector<sta tic subAtemplist;
static int count;
public:
static void setMyList();
static vector<super*ge tMyList();
};
std::vector<sup er*>foo::myList ;
std::vector<sub Afoo::templist;
int foo:: count = 0;
void foo::setMyList( ){
subA mysubA;
templist.push_b ack(mysubA);
myList.push_bac k(&(templist[count]));
count++;
cout<< count << " time call setMyList" << endl;
}
vector<super*fo o::getMyList()
{
return myList;
}
main()
{
foo::setMyList( );
foo::setMyList( );
vector<super*ne wList;
newList = foo::getMyList( );
newList[0]->printOut();}
What I really try to achieve is to set the myList to a vector of
pointers of super type, but actually points to the derived class
objects. I use a static vector of subA to store the sub object, so
that I could use its address to initilize myList( I know this is very
ugly, but I haven't figure out other method). But my problem is that
myList is not properly set as I expected. For example, as above
program will crush as try to execute newList[0]->printOut(). I
figured out that everytime templist calls push_back, its address has
been changed ( the first time is 0x0033c10, and second time after
push_back is called, its address has been changed) so that myList
first pointer points to nowhere, but I have already defined the
templist as static. Can anyone explain this to me? I hope I explain
myself clearly.
Apparently my previous response didn't go through or has been delayed.
The fundamental problem is that templist is being resized by the
push_back, which invalidates all pointers and iterators. Try this
instead:
#include <iostream>
#include <vector>
using namespace std;
struct super
{
virtual ~super() {}
virtual void printOut()
{ cout << "super\n";}
};
struct subA : super
{
virtual void printOut()
{ cout << "subA\n"; }
};
class foo
{
vector<super*my List;
public:
~foo()
{
for( size_t n=0; n < myList.size(); ++n )
{
delete myList[n];
}
}
void setMyList()
{
myList.push_bac k( new subA );
cout<< "called setMyList" << endl;
}
vector<super*ge tMyList() const
{
return myList;
}
};
int main()
{
foo f;
f.setMyList();
f.setMyList();
const vector<super*ne wList = f.getMyList();
for( size_t n=0; n < newList.size(); ++n )
{
newList[n]->printOut();
}
}
Cheers! --M

Thanks a lot. Your program makes much more sense than mine. Just want
to ask you a further question(sorrry if it is stupid). Does resize
means that everytime calls push_back(), the first address of memory
will change (not just adding the memory on the existing one)?

Many thanks,
Jia

Apr 21 '07 #5
On Apr 21, 2:09 am, Jia <JiaLi...@gmail .comwrote:
On 20 Apr, 22:12, mlimber <mlim...@gmail. comwrote:
Thanks a lot. Your program makes much more sense than mine. Just want
to ask you a further question(sorrry if it is stupid). Does resize
means that everytime calls push_back(), the first address of memory
will change (not just adding the memory on the existing one)?
It might. Formally, changes in capacity() will cause
invalidation of pointers, references and iterators into the
vector. If you know the final size of the vector, for example,
you can call reserve beforehand, and be sure that push_back
never invalidates anything. Because of the complexity
constraints, too, not every push_back can change the capacity;
but if you've not verified the capacity before hand, or used
reserve, you don't know which ones might.

--
James Kanze (Gabi Software) email: ja*********@gma il.com
Conseils en informatique orientée objet/
Beratung in objektorientier ter Datenverarbeitu ng
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34

Apr 21 '07 #6
Jia
On 21 Apr, 03:22, mlimber <mlim...@gmail. comwrote:
On Apr 20, 8:09 pm,Jia<JiaLi... @gmail.comwrote :
On 20 Apr, 22:12, mlimber <mlim...@gmail. comwrote:
On Apr 20, 11:21 am,Jia<JiaLi... @gmail.comwrote :
Hi all,
I have a class foo which has a static vector of pointers of type base
class, and a static function to set this vector.
#include <iostream>
#include <vector>
using namespace std;
class super{
protected:
int a;
public:
virtual void printOut(){ cout << "super " << endl;}
};
class subA : public super{
protected:
int a_a;
public:
virtual void printOut(){ cout << "subA" << endl;}
};
class subB : public super{
protected:
int a_b;
public:
virtual void printOut(){cout << "subB" << endl;}
};
class foo {
protected:
static std::vector<sup er*myList;
static std::vector<sta tic subAtemplist;
static int count;
public:
static void setMyList();
static vector<super*ge tMyList();
};
std::vector<sup er*>foo::myList ;
std::vector<sub Afoo::templist;
int foo:: count = 0;
void foo::setMyList( ){
subA mysubA;
templist.push_b ack(mysubA);
myList.push_bac k(&(templist[count]));
count++;
cout<< count << " time call setMyList" << endl;
}
vector<super*fo o::getMyList()
{
return myList;
}
main()
{
foo::setMyList( );
foo::setMyList( );
vector<super*ne wList;
newList = foo::getMyList( );
newList[0]->printOut();}
What I really try to achieve is to set the myList to a vector of
pointers of super type, but actually points to the derived class
objects. I use a static vector of subA to store the sub object, so
that I could use its address to initilize myList( I know this is very
ugly, but I haven't figure out other method). But my problem is that
myList is not properly set as I expected. For example, as above
program will crush as try to execute newList[0]->printOut(). I
figured out that everytime templist calls push_back, its address has
been changed ( the first time is 0x0033c10, and second time after
push_back is called, its address has been changed) so that myList
first pointer points to nowhere, but I have already defined the
templist as static. Can anyone explain this to me? I hope I explain
myself clearly.
Apparently my previous response didn't go through or has been delayed.
The fundamental problem is that templist is being resized by the
push_back, which invalidates all pointers and iterators. Try this
instead:
#include <iostream>
#include <vector>
using namespace std;
struct super
{
virtual ~super() {}
virtual void printOut()
{ cout << "super\n";}
};
struct subA : super
{
virtual void printOut()
{ cout << "subA\n"; }
};
class foo
{
vector<super*my List;
public:
~foo()
{
for( size_t n=0; n < myList.size(); ++n )
{
delete myList[n];
}
}
void setMyList()
{
myList.push_bac k( new subA );
cout<< "called setMyList" << endl;
}
vector<super*ge tMyList() const
{
return myList;
}
};
int main()
{
foo f;
f.setMyList();
f.setMyList();
const vector<super*ne wList = f.getMyList();
for( size_t n=0; n < newList.size(); ++n )
{
newList[n]->printOut();
}
}
Cheers! --M
Thanks a lot. Your program makes much more sense than mine. Just want
to ask you a further question(sorrry if it is stupid). Does resize
means that everytime calls push_back(), the first address of memory
will change (not just adding the memory on the existing one)?

Not necessarily, but it could. It depends on whether or not there is
unused capacity in the vector where the new element could be created.
You can use the reserve member function to specify the desired
capacity (which is different from the size), and when the capacity is
exceeded on push_back, the vector will grow by doubling its capacity
and then increasing its size by one. If the capacity is not exceeded,
no growing is necessary, so iterators and pointers are not
invalidated.

BTW, a couple of other remarks about your program that were lost from
my original reply:

Returning the vector like this:

vector<super*ne wList;
newList = foo::getMyList( );

instead of like this:

vector<super*ne wList = foo::getMyList( );

will likely introduce an extra, temporary copy of the vector. The
latter makes use of the return value optimization to eliminate this
copy.

In any case, it's usually better to hide your underlying
representation via encapsulation (seehttp://www.parashift.c om/c++-faq-lite/classes-and-objects.html#fa q-7.4),
which in this case would likely mean that you give foo a member
function to do the printing for all of its "super" objects rather than
handing out copies of the vector in which it holds them.

Note that I added a virtual destructor to super (seehttp://www.parashift.c om/c++-faq-lite/virtual-functions.html# faq-20.7).

Also, instead of using the destructor that I added to foo, you could
use a smart pointer with container-compatible copy semantics, such as
std::tr1::share d_ptr (aka boost::shared_p tr), Loki::SmartPtr (with
reference counting policies etc.), or the reference counted smart
pointer from this FAQ and those following:

http://www.parashift.com/c++-faq-lit...html#faq-16.22

I omitted this for brevity and clarity, but it's what I would use in
your shoes.

Cheers! --M
I see now. Thanks a lot for giving me those links.

Apr 21 '07 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1309
by: | last post by:
I think, a class template with a static vector member: ---------------------------- template <class C> struct Shared { unsigned int count; C data; }; template <class C>
5
2672
by: Vincent RICHOMME | last post by:
Hi, First my questions are related to C++ even if I am talking about managed c++(.NET)... I am currently implementing some interesting .NET classes in c++(native code) and I am not an expert with static methods. Here is what I am doing (class to manage processes) :
11
3076
by: toton | last post by:
Hi, I have little confusion about static memory allocation & dynamic allocation for a cluss member. I have class like class Bar{ public: explicit Bar(){ cout<<"bar default"<<endl; }
5
3614
by: mast2as | last post by:
Hi guys Here's the class I try to compile (see below). By itself when I have a test.cc file for example that creates an object which is an instance of the class SpectralProfile, it compiles fine. 1 / Now If I move the getSpectrumAtDistance( const T &dist ) method definition in SpectralProfofile.cc let's say the compiler says core/profile.cc:199: error: `kNumBins' was not declared in this scope
7
8231
by: Jo | last post by:
Hi, How can i differentiate between static and dynamic allocated objects? For example: void SomeFunction1() { CObject *objectp = new CObject; CObject object;
8
2905
by: crjjrc | last post by:
Hi, I've got a base class and some derived classes that look something like this: class Base { public: int getType() { return type; } private: static const int type = 0; };
4
3524
by: Josefo | last post by:
Hello, is someone so kind to tell me why I am getting the following errors ? vector_static_function.c:20: error: expected constructor, destructor, or type conversion before '.' token vector_static_function.c:21: error: expected constructor, destructor, or type conversion before '.' token
5
1768
by: Jim Langston | last post by:
The output of the following program for me is: Same 0 1 2 Which is what I want. I just want to confirm this is well defined behavior, that a static local variable to a class function/method is the same instance across classes. #include <iostream> #include <vector>
11
5336
by: Andreas Wollschlaeger | last post by:
Hi folks, as the subject says, i'm a poor Java programmer trying to transfer some of his wisdom into C++ world... here is what im trying to do this evening: Java has a nifty feature called a static class initializer - something like this: public class Foo {
0
10039
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9881
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10923
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10542
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
8100
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7256
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5943
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
6148
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4778
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.