question about CiOpen class - page 2

 

thanks for your reply @Alain Verleyen, now I understand it little bit better, although I am still confused


it seems that CiOpen class extends m_data[] from CArrayObj class and this array has size of 16 by default.


and when the CiOpen.Refresh() is called, a CDoubleBuffer is created (which it also extends it's own m_data[] array from CArrayDouble, and this m_data[] has size 1024 by default), and then after populating 1024 open prices into m_data[],  then the the whole CDoubleBuffer is put inside m_data[] of CArrayObj class at 0 index


maybe Im wrong, Im not sure

 
farhadmax #:

thanks for your reply @Alain Verleyen, now I understand it little bit better, although I am still confused


it seems that CiOpen class extends m_data[] from CArrayObj class and this array has size of 16 by default.


and when the CiOpen.Refresh() is called, a CDoubleBuffer is created (which it also extends it's own m_data[] array from CArrayDouble, and this m_data[] has size 1024 by default), and then after populating 1024 open prices into m_data[],  then the the whole CDoubleBuffer is put inside m_data[] of CArrayObj class at 0 index


maybe Im wrong, Im not sure

It's correct, the confusion can come from the fact that there are several m_data array which are not the same, the array of buffers is of CObject*[] type(16 by default, but only 1 is really instantiated and used with CiOpen), and price buffer which is 1024 by default which is of double[] type.
 

mmmm, now its much clear for me, thanks to you Alain.

I still need to study more source codes, I haven't looked at CIndicator class yet, I'm guessing classes which extend CIndicator (like CiMACD and etc) would occupate 2 indexes of m_data[] of CArrayObj (m_data[0] and m_data[1] ) because  MACD  has 2 lines so it needs 2 arrays to hold MACD line data.

again, this is a guess, I'm not quite sure. I need to check the source code.


3 points here:

1- why in using method names, they don't follow get/set convention?  like getSize() / setSize()

2- they could use more descriptive variable name for m_data[] of CArrayObj class. like buffersArray[] or so (as you also confirmed, it makes a little bit confusion)

3- what is the point of 16 for m_data[] size? why not 20 for example?


for now, these questions comes to my mind. maybe in the future, I ask more questions here in this thread. and maybe I write an article and help others about standard classes :) but until then, I should make my own understandings solid.

and thanks to you Alian that spend your time and help others

 
farhadmax #:

mmmm, now its much clear for me, thanks to you Alain.

I still need to study more source codes, I haven't looked at CIndicator class yet, I'm guessing classes which extend CIndicator (like CiMACD and etc) would occupate 2 indexes of m_data[] of CArrayObj (m_data[0] and m_data[1] ) because  MACD  has 2 lines so it needs 2 arrays to hold MACD line data.

again, this is a guess, I'm not quite sure. I need to check the source code.


3 points here:

1- why in using method names, they don't follow get/set convention?  like getSize() / setSize()

2- they could use more descriptive variable name for m_data[] of CArrayObj class. like buffersArray[] or so (as you also confirmed, it makes a little bit confusion)

3- what is the point of 16 for m_data[] size? why not 20 for example?


for now, these questions comes to my mind. maybe in the future, I ask more questions here in this thread. and maybe I write an article and help others about standard classes :) but until then, I should make my own understandings solid.

and thanks to you Alain that spend your time and help others

You are welcome.

However I have to stop on this, as I don't have much time and I don't even use the "not so" Standard Library

Hopefully someone will be able to help you if needed, or maybe you will become the master of the SL.