hello,

I need to extend ns-2 a littel to determin period of time I need to run
a crb traffic generator. For this I have added a VideoTrace class and
store amount of data to be transported over cbr in video_size_.

I would like to determine cbr_end time as stated below in ns-2 sim
script. For this purpose I need to have access to video_size_ variable
from sim code.

cbr_end = video_size_/cbr_rate

=============== ns-2 simulation script ====================
../skipping     
set encoder_trace [new VideoTrace]
? how to access video_size_ here to calculate crb_end value?

Below is the relevant code from video.h and video.cc:


=============== video.h ====================
class VideoTrace : public NsObject {

public:
         u_int32_t       video_size_;            //size of video in bytes
         VideoTrace();
         int command(int argc, const char*const* argv);
};

=============== video.cc ====================
static class VideoTraceClass : public TclClass {

public:
        VideoTraceClass() : TclClass("VideoTrace") {}
        TclObject* create(int, const char*const*) {
        return (new VideoTrace());
                                                        }
} class_video_trace;


VideoTrace::VideoTrace() :  status_(0)
{
        video_size_ = 9999;
        bind("video_size_", &video_size_);
}
         

Your comments are very much appreciated. If you think there is another
and/or better way, please share it with me.

Regards,
-- 
Luqman

Reply via email to